Skip to content

"disabled" options are still used by autocomplete #413

Open
@philgyford

Description

@philgyford

If I have a select field like this:

<select name="test" id="test">
  <option value="">Select...</option>
  <option value="a">A</option>
  <option value="b" disabled>B</option>
  <option value="c">C</option>
</select>

And enable autocomplete like this:

<script>
  accessibleAutocomplete.enhanceSelectElement({
    defaultValue: '',
    selectElement: document.querySelector('#test')
  });
</script>

Then if I type "B" in the autocomplete input field, B is chosen. I would expect it to not be available.

(I can imagine there might be good reasons why gov.uk doesn't use disabled -- maybe it's poor accessibility? Some other reason? In which case I understand why this doesn't support the option :) But as an outsider using this otherwise excellent tool, this was unexpected behaviour.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestUser requests a new feature🐛 bugSomething isn't working the way it should (including incorrect wording in documentation)🕔 daysA few unknowns, but we roughly know what’s involved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions