Skip to content

[autocomplete] useAutocomplete hook disabled option can be clicked #44

@phiter

Description

@phiter

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/compassionate-chatelet-qz92q4?file=/Demo.tsx

Steps:

  1. Have an autocomplete hook with the getOptionDisabled option working
  2. Pass some disabled option
  3. Click the disabled option

Current behavior 😯

The disabled option can be clicked, even though if inspected, it has aria-disabled="true" attribute.

Expected behavior 🤔

The option should not be clickable.

Context 🔦

I'm creating a custom Autocomplete input with the useAutocomplete hook, but this is failing on my tests.

Your environment 🌎

npx @mui/envinfo
  System:
    OS: macOS 13.5.1
  Binaries:
    Node: 18.12.1 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.npm-global/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 116.0.5845.96 <-- tested here
    Edge: 114.0.1823.55
    Safari: 16.6

Metadata

Metadata

Assignees

Labels

package: @mui/baseSpecific to @mui/base (legacy).type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions