From 8524b3529b99de0c50d47cdab4373ecdc6083faa Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 13 Aug 2019 16:09:57 +0200 Subject: [PATCH] Other: Made the text highlight toolbar more accessible by providing an aria-label (see ckeditor/ckeditor5#1404). --- lang/contexts.json | 3 ++- src/highlightui.js | 2 ++ tests/highlightui.js | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lang/contexts.json b/lang/contexts.json index 9f2e5a5..5e516fc 100644 --- a/lang/contexts.json +++ b/lang/contexts.json @@ -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 describing the highlight feature toolbar used by assistive technologies." } diff --git a/src/highlightui.js b/src/highlightui.js index 8b32f91..fdd17db 100644 --- a/src/highlightui.js +++ b/src/highlightui.js @@ -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 } ); diff --git a/tests/highlightui.js b/tests/highlightui.js index 4dc3a22..5c933e4 100644 --- a/tests/highlightui.js +++ b/tests/highlightui.js @@ -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;