This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 16
16
"Merge cell left" : " Label for the merge table cell left button." ,
17
17
"Split cell vertically" : " Label for the split table cell vertically button." ,
18
18
"Split cell horizontally" : " Label for the split table cell horizontally button." ,
19
- "Merge cells" : " Label for the merge table cells button."
19
+ "Merge cells" : " Label for the merge table cells button." ,
20
+ "Table toolbar" : " The label used by assistive technologies describing a table toolbar attached to a table widget."
20
21
}
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export default class TableToolbar extends Plugin {
42
42
*/
43
43
afterInit ( ) {
44
44
const editor = this . editor ;
45
+ const t = editor . t ;
45
46
const widgetToolbarRepository = editor . plugins . get ( WidgetToolbarRepository ) ;
46
47
47
48
const tableContentToolbarItems = editor . config . get ( 'table.contentToolbar' ) ;
@@ -50,13 +51,15 @@ export default class TableToolbar extends Plugin {
50
51
51
52
if ( tableContentToolbarItems ) {
52
53
widgetToolbarRepository . register ( 'tableContent' , {
54
+ ariaLabel : t ( 'Table toolbar' ) ,
53
55
items : tableContentToolbarItems ,
54
56
getRelatedElement : getTableWidgetAncestor
55
57
} ) ;
56
58
}
57
59
58
60
if ( tableToolbarItems ) {
59
61
widgetToolbarRepository . register ( 'table' , {
62
+ ariaLabel : t ( 'Table toolbar' ) ,
60
63
items : tableToolbarItems ,
61
64
getRelatedElement : getSelectedTableWidget
62
65
} ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,14 @@ describe( 'TableToolbar', () => {
94
94
balloonClassName : 'ck-toolbar-container'
95
95
} ) ;
96
96
} ) ;
97
+
98
+ it ( 'should set aria-label attribute' , ( ) => {
99
+ toolbar . render ( ) ;
100
+
101
+ expect ( toolbar . element . getAttribute ( 'aria-label' ) ) . to . equal ( 'Table toolbar' ) ;
102
+
103
+ toolbar . destroy ( ) ;
104
+ } ) ;
97
105
} ) ;
98
106
99
107
describe ( 'integration with the editor focus' , ( ) => {
You can’t perform that action at this time.
0 commit comments