Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: The text highlight toolbar should have a proper aria-label a…
Browse files Browse the repository at this point in the history
…ttribute (see ckeditor/ckeditor5#1404).
  • Loading branch information
oleq committed Aug 13, 2019
2 parents 1645f26 + b481bd4 commit 3ee2ea0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lang/contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"Red pen": "Toolbar button tooltip for applying red pen (text color).",
"Green pen": "Toolbar button tooltip for applying green pen (text color).",
"Remove highlight": "Toolbar button tooltip for removing text highlight.",
"Highlight": "Toolbar button tooltip for the text highlight feature."
"Highlight": "Toolbar button tooltip for the text highlight feature.",
"Text highlight toolbar": "Label used by assistive technologies describing the highlight feature toolbar."
}
2 changes: 2 additions & 0 deletions src/highlightui.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ export default class HighlightUI extends Plugin {
addToolbarToDropdown( dropdownView, buttons );
bindToolbarIconStyleToActiveColor( dropdownView );

dropdownView.toolbarView.ariaLabel = t( 'Text highlight toolbar' );

// Execute current action from dropdown's split button action button.
splitButtonView.on( 'execute', () => {
editor.execute( 'highlight', { value: splitButtonView.commandValue } );
Expand Down
6 changes: 6 additions & 0 deletions tests/highlightui.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ describe( 'HighlightUI', () => {
expect( button ).to.have.property( 'isToggleable', true );
} );

it( 'toolbar nas the basic properties', () => {
const toolbarView = dropdown.toolbarView;

expect( toolbarView ).to.have.property( 'ariaLabel', 'Text highlight toolbar' );
} );

it( 'should have proper icons in dropdown', () => {
const toolbar = dropdown.toolbarView;

Expand Down

0 comments on commit 3ee2ea0

Please sign in to comment.