Skip to content

Commit

Permalink
On branch ci/storybook-tests: fix a11y issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezhik Kyzyl-ool committed Jul 10, 2024
1 parent 913c38e commit 626df78
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@
"prettier --write"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export default {
id: 'color-contrast',
enabled: false,
},
{
id: 'definition-list', // todo: https://github.com/gravity-ui/components/issues/207
enabled: false,
},
],
},
},
Expand Down
16 changes: 15 additions & 1 deletion src/components/DefinitionList/components/Term.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import {HelpPopover} from '../../HelpPopover';
import i18n from '../i18n';
import {DefinitionListItemNote, DefinitionListSingleItem} from '../types';
import {b, getTitle} from '../utils';

Expand All @@ -19,12 +20,25 @@ function NoteElement({note}: NoteElementsProps) {
className={popoverClassName}
content={note}
placement={['bottom', 'top']}
buttonProps={{
'aria-label': i18n('label_note'),
}}
/>
);
}

if (typeof note === 'object') {
return <HelpPopover className={popoverClassName} placement={['bottom', 'top']} {...note} />;
return (
<HelpPopover
className={popoverClassName}
placement={['bottom', 'top']}
{...note}
buttonProps={{
'aria-label': i18n('label_note'),
...note.buttonProps,
}}
/>
);
}
return null;
}
Expand Down

0 comments on commit 626df78

Please sign in to comment.