Przeglądaj źródła

Other: Made the text alignment toolbar more accessible by providing an aria-label (see ckeditor/ckeditor5#1404).

Aleksander Nowodzinski 6 lat temu
rodzic
commit
9461940ed3

+ 2 - 1
packages/ckeditor5-alignment/lang/contexts.json

@@ -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 describing the text alignment feature toolbar used by assistive technologies."
 }

+ 1 - 0
packages/ckeditor5-alignment/src/alignmentui.js

@@ -93,6 +93,7 @@ export default class AlignmentUI extends Plugin {
 			} );
 
 			dropdownView.toolbarView.isVertical = true;
+			dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );
 
 			dropdownView.extendTemplate( {
 				attributes: {

+ 2 - 1
packages/ckeditor5-alignment/tests/alignmentui.js

@@ -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', () => {