-
-
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
Add the visual label to the beginning of the programmatic heading dropdown aria label #16024
Conversation
…in heading dropdown
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 solution is correct. What we're missing:
- unit tests,
and as per original issue
The same issue exists in other dropdown controls.
- an integration with text part language (the aria-label is "Language" but it displays "French")

@@ -124,6 +124,21 @@ export default class HeadingUI extends Plugin { | |||
return titles[ whichModel ]; | |||
} ); | |||
|
|||
dropdownView.buttonView.bind( 'ariaLabel' ).to( headingCommand, 'value', paragraphCommand, 'value', ( value, para ) => { | |||
const whichModel = value || para && 'paragraph'; |
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.
Since we're visiting this code for the first time since 2018, can you please rewrite it to human-readable code using if/else or at least the ternary operator? 🙂 (I know you copied it from dropdownView.buttonView.bind( 'label' )...
, you can change it there too)
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.
I reduced this one line to const whichModel = paragraph ? 'paragraph' : heading;
. Seems to be working correctly.
Suggested merge commit message (convention)
Fix (heading): Set the visual label to the beginning of the programmatic aria label in heading and language dropdowns.
Closes https://github.com/cksource/ckeditor5-commercial/issues/6029