loading up the forgejo repo on tangled to test page performance
1import {linkLabelAndInput} from './base.js';
2
3export function initAriaFormFieldPatch() {
4 // link the label and the input element so it's clickable and accessible
5 for (const el of document.querySelectorAll('.ui.form .field')) {
6 if (el.hasAttribute('data-field-patched')) continue;
7 const label = el.querySelector(':scope > label');
8 const input = el.querySelector(':scope > input');
9 if (!label || !input) continue;
10 linkLabelAndInput(label, input);
11 el.setAttribute('data-field-patched', 'true');
12 }
13}