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

Name, role, value accessibility fixes #16295

Merged
merged 5 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ckeditor5-minimap/src/minimapiframeview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class MinimapIframeView extends IframeView {
this.extendTemplate( {
attributes: {
tabindex: -1,
'aria-hidden': 'true',
class: [
'ck-minimap__iframe'
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export default class RestrictedEditingModeUI extends Plugin {
listItems.add( this._getButtonDefinition( commandName, label, keystroke ) );
} );

addListToDropdown( dropdownView, listItems );
addListToDropdown( dropdownView, listItems, {
role: 'menu'
} );

dropdownView.buttonView.set( {
label: t( 'Navigate editable regions' ),
Expand Down Expand Up @@ -141,6 +143,7 @@ export default class RestrictedEditingModeUI extends Plugin {
withText: true,
keystroke,
withKeystroke: true,
role: 'menuitem',
_commandName: commandName
} )
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ describe( 'RestrictedEditingModeUI', () => {
expect( button ).to.have.property( 'isOn', false );
} );

it( 'has role="menu" attribute set in items list', () => {
dropdown.isOpen = true;

expect( dropdown.panelView.children.first.role ).to.be.equal( 'menu' );
} );

describe( 'exceptions navigation buttons', () => {
beforeEach( () => {
dropdown.render();
Expand All @@ -84,6 +90,7 @@ describe( 'RestrictedEditingModeUI', () => {
expect( button.withKeystroke ).to.be.true;
expect( button.label ).to.equal( 'Previous editable region' );
expect( button.keystroke ).to.equal( 'Shift+Tab' );
expect( button.role ).to.equal( 'menuitem' );
} );

it( 'should have one that goes forward', () => {
Expand All @@ -95,6 +102,7 @@ describe( 'RestrictedEditingModeUI', () => {
expect( button.withKeystroke ).to.be.true;
expect( button.label ).to.equal( 'Next editable region' );
expect( button.keystroke ).to.equal( 'Tab' );
expect( button.role ).to.equal( 'menuitem' );
} );

it( 'should focus the view after executing the command', () => {
Expand Down