You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Search field has neither id nor name, Chrome reports "A form field element should have an id or name attribute" #6472
The search fields Select2 creates have no id and no name. Chrome DevTools lists each one in the Issues panel
as "A form field element should have an id or name attribute" (the browser cannot autofill a field it cannot
identify). This applies to both search fields:
the inline <textarea class="select2-search__field"> of a multiple select (src/js/select2/selection/search.js)
the <input class="select2-search__field"> in the dropdown of a single select (src/js/select2/dropdown/search.js)
The fields already have an aria-label, so this is not an accessibility failure, but the advisory shows up on
every page that uses Select2.
Expected: no issue; the search field has an id derived from the select, as the other generated elements
already do (select2-fruits-container, select2-fruits-results).
Actual: "A form field element should have an id or name attribute", 1 resource: the textarea.select2-search__field.
Suggestion: give the search field an id from the container id Select2 already generates
(_generateId in core.js), for example select2-<id>-search for the inline field and select2-<id>-dropdown-search for the dropdown one. A name would be worse: the field would then be
submitted with the form.
Activity