code.gitea.io/gitea@v1.22.3/web_src/js/modules/fomantic/form.js (about)

     1  import {linkLabelAndInput} from './base.js';
     2  
     3  export 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  }