Skip to content

Commit 9b94b39

Browse files
committed
add comments
1 parent ae3268c commit 9b94b39

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: web_src/js/features/aria.js

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export function attachDropdownAria($dropdowns) {
101101

102102
export function attachCheckboxAria($checkboxes) {
103103
$checkboxes.checkbox();
104+
105+
// Fomantic UI checkbox needs to be something like: <div class="ui checkbox"><label /><input /></div>
106+
// It doesn't work well with <label><input />...</label>
107+
// To make it work with aria, the "id"/"for" attributes are necessary, so add them automatically if missing.
108+
// In the future, refactor to use native checkbox directly, then this patch could be removed.
104109
for (const el of $checkboxes) {
105110
const label = el.querySelector('label');
106111
const input = el.querySelector('input');

0 commit comments

Comments
 (0)