Improve usability of toggled button labels (#12426)

* feat(a11y) buttons can now have toggled-aware a11y labels
This commit is contained in:
Emmanuel Pelletier
2023-03-13 09:19:28 +01:00
committed by GitHub
parent 27765b47d7
commit 45b7f53294
15 changed files with 108 additions and 148 deletions

View File

@@ -26,25 +26,11 @@ type Props = AbstractButtonProps & {
*/
class OverflowToggleButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.closeMoreActions';
icon = IconDotsHorizontal;
label = 'toolbar.moreActions';
toggledLabel = 'toolbar.moreActions';
/**
* Retrieves tooltip dynamically.
*/
get tooltip() {
return 'toolbar.moreActions';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
tooltip = 'toolbar.moreActions';
/**
* Indicates whether this button is in toggled state or not.