Skip to content
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

Merged
merged 22 commits into from
Apr 20, 2023

Conversation

mmotyczynska
Copy link
Contributor

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.

@Dumluregn Dumluregn requested review from oleq and illia-stv April 18, 2023 08:05
Copy link
Contributor

@illia-stv illia-stv left a 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!!!

Comment on lines +146 to +151
declare public role: string | undefined;

/**
* @inheritDoc
*/
declare public ariaChecked: boolean | undefined;
Copy link
Member

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?

Copy link
Contributor Author

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' ),
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test added.

Comment on lines 150 to 158
/**
* @inheritDoc
*/
declare public ariaLabel?: string | undefined;

/**
* @inheritDoc
*/
declare public ariaLabelledBy: string | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these?

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing API docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Comment on lines +93 to +94
ariaLabel: accessibleLabel,
ariaLabelledBy: undefined,
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Added.

@mmotyczynska mmotyczynska requested a review from oleq April 19, 2023 15:33
@oleq oleq merged commit 2fe4416 into master Apr 20, 2023
@oleq oleq deleted the ck/13250-accessibility-selected-state-for-dropdowns-v3 branch April 20, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants