Files

14 lines
510 B
TypeScript
Raw Permalink Normal View History

import {linkLabelAndInput} from './base.ts';
export function initAriaCheckboxPatch() {
2024-03-29 05:56:01 +01:00
// link the label and the input element so it's clickable and accessible
for (const el of document.querySelectorAll('.ui.checkbox')) {
if (el.hasAttribute('data-checkbox-patched')) continue;
const label = el.querySelector('label');
const input = el.querySelector('input');
2024-03-31 01:00:58 +01:00
if (!label || !input) continue;
linkLabelAndInput(label, input);
2024-03-29 05:56:01 +01:00
el.setAttribute('data-checkbox-patched', 'true');
}
}