-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility for Font size/family and Heading dropdowns in toolbar #13893
Accessibility for Font size/family and Heading dropdowns in toolbar #13893
Conversation
…ity-selected-state-for-dropdowns-v3
…ity-selected-state-for-dropdowns-v3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks good!!!
declare public role: string | undefined; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
declare public ariaChecked: boolean | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need these in the Button
interface as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we do. Added.
type: bind.to( 'type', value => value ? value : 'button' ), | ||
tabindex: bind.to( 'tabindex' ), | ||
'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`, | ||
'aria-label': bind.to( 'ariaLabel' ), | ||
'aria-labelledby': bind.to( 'ariaLabelledBy' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing test checks if aria-labelledby
starts with ck-editor__aria-label
. This is a default value but we also need a test to see if the new observable ariaLabelledBy
property is actually observable and what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test added.
/** | ||
* @inheritDoc | ||
*/ | ||
declare public ariaLabel?: string | undefined; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
declare public ariaLabelledBy: string | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't. Last time I checked this I was getting errors regarding not implementing the interface correctly for SplitButtonView. But now it seems to work without these declarations.
@@ -310,6 +310,7 @@ export function addListToDropdown( | |||
itemsOrCallback: Collection<ListDropdownItemDefinition> | ( () => Collection<ListDropdownItemDefinition> ), | |||
options: { | |||
ariaLabel?: string; | |||
role?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing API docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
ariaLabel: accessibleLabel, | ||
ariaLabelledBy: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes have no test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Added.
Suggested merge commit message (convention)
Fix (font, heading): Screen readers should now announce selected option in dropdown lists for font size, font family and heading. Closes #13250.
Additional information
There was already one solution in which we tried to implement this but it was not good enough. As described here, we decided to go with another approach.
Besides font we added here also heading feature to make sure that this time the proposed solution will cover also dropdowns with the selected value shown in the toolbar.