File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -98,3 +98,15 @@ function attachOneDropdownAria($dropdown) {
9898export function attachDropdownAria ( $dropdowns ) {
9999 $dropdowns . each ( ( _ , e ) => attachOneDropdownAria ( $ ( e ) ) ) ;
100100}
101+
102+ export function attachCheckboxAria ( $checkboxes ) {
103+ $checkboxes . checkbox ( ) ;
104+ for ( const el of $checkboxes ) {
105+ const label = el . querySelector ( 'label' ) ;
106+ const input = el . querySelector ( 'input' ) ;
107+ if ( ! label || ! input || input . getAttribute ( 'id' ) ) continue ;
108+ const id = generateAriaId ( ) ;
109+ input . setAttribute ( 'id' , id ) ;
110+ label . setAttribute ( 'for' , id ) ;
111+ }
112+ }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import {mqBinarySearch} from '../utils.js';
44import { createDropzone } from './dropzone.js' ;
55import { initCompColorPicker } from './comp/ColorPicker.js' ;
66import { showGlobalErrorMessage } from '../bootstrap.js' ;
7- import { attachDropdownAria } from './aria.js' ;
7+ import { attachCheckboxAria , attachDropdownAria } from './aria.js' ;
88import { handleGlobalEnterQuickSubmit } from './comp/QuickSubmit.js' ;
99import { initTooltip } from '../modules/tippy.js' ;
1010import { svg } from '../svg.js' ;
@@ -111,7 +111,7 @@ export function initGlobalCommon() {
111111 } ) ;
112112 attachDropdownAria ( $uiDropdowns ) ;
113113
114- $ ( '.ui.checkbox' ) . checkbox ( ) ;
114+ attachCheckboxAria ( $ ( '.ui.checkbox' ) ) ;
115115
116116 $ ( '.tabular.menu .item' ) . tab ( ) ;
117117 $ ( '.tabable.menu .item' ) . tab ( ) ;
You can’t perform that action at this time.
0 commit comments