This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit ae3268c
1 parent a31fedd commit ae3268c Copy full SHA for ae3268c
File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -98,3 +98,15 @@ function attachOneDropdownAria($dropdown) {
98
98
export function attachDropdownAria ( $dropdowns ) {
99
99
$dropdowns . each ( ( _ , e ) => attachOneDropdownAria ( $ ( e ) ) ) ;
100
100
}
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';
4
4
import { createDropzone } from './dropzone.js' ;
5
5
import { initCompColorPicker } from './comp/ColorPicker.js' ;
6
6
import { showGlobalErrorMessage } from '../bootstrap.js' ;
7
- import { attachDropdownAria } from './aria.js' ;
7
+ import { attachCheckboxAria , attachDropdownAria } from './aria.js' ;
8
8
import { handleGlobalEnterQuickSubmit } from './comp/QuickSubmit.js' ;
9
9
import { initTooltip } from '../modules/tippy.js' ;
10
10
import { svg } from '../svg.js' ;
@@ -111,7 +111,7 @@ export function initGlobalCommon() {
111
111
} ) ;
112
112
attachDropdownAria ( $uiDropdowns ) ;
113
113
114
- $ ( '.ui.checkbox' ) . checkbox ( ) ;
114
+ attachCheckboxAria ( $ ( '.ui.checkbox' ) ) ;
115
115
116
116
$ ( '.tabular.menu .item' ) . tab ( ) ;
117
117
$ ( '.tabable.menu .item' ) . tab ( ) ;
You can’t perform that action at this time.
0 commit comments