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 alignment 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 599ea01 + cfc1e78 commit 3ed81de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lang/contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"Align right": "Toolbar button tooltip for aligning the text to the right.",
"Align center": "Toolbar button tooltip for aligning the text to center.",
"Justify": "Toolbar button tooltip for making the text justified.",
"Text alignment": "Dropdown button tooltip for the text alignment feature."
"Text alignment": "Dropdown button tooltip for the text alignment feature.",
"Text alignment toolbar": "Label used by assistive technologies describing the text alignment feature toolbar."
}
1 change: 1 addition & 0 deletions src/alignmentui.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class AlignmentUI extends Plugin {
} );

dropdownView.toolbarView.isVertical = true;
dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );

dropdownView.extendTemplate( {
attributes: {
Expand Down
3 changes: 2 additions & 1 deletion tests/alignmentui.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ describe( 'Alignment UI', () => {
expect( dropdown.element.classList.contains( 'ck-alignment-dropdown' ) ).to.be.true;
} );

it( '#toolbarView has the base properties', () => {
it( '#toolbarView has the basic properties', () => {
const toolbarView = dropdown.toolbarView;

expect( toolbarView ).to.have.property( 'isVertical', true );
expect( toolbarView ).to.have.property( 'ariaLabel', 'Text alignment toolbar' );
} );

it( 'should hold defined buttons', () => {
Expand Down

0 comments on commit 3ed81de

Please sign in to comment.