mui / mui/material-ui

[autocomplete] Add equivalent to openOnFocus for `click` events

Open
#23,164 24 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope: autocomplete type: new feature
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

openOnFocus does not affect what happens when an out-of-focus input is clicked. In the comments of #20286, it was argued that this is by design. As such, I hereby request an equivalent (suggested: disableOpenOnClick) prop that disables opening the suggestions on click.

Motivation 🔦

I had to add this to the embedded TextField

          [...]
          onMouseDownCapture={ (e) => e.stopPropagation()}
          [...]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Autocomplete component's handling of focus and click events, then read the discussion in issue #20286 and this issue's 24 comments for the intended behavior. Done means a supported option provides the requested distinction between opening on focus and opening on click, with the relevant behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.