Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete] multiselect clearIndicator not working when focus is on autocomplete and limitTags is set #44116

Closed
jbrunner92 opened this issue Oct 15, 2024 · 6 comments
Assignees
Labels
component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@jbrunner92
Copy link

jbrunner92 commented Oct 15, 2024

Steps to reproduce

Link to live example: (required)

This is the mui demo itself for limiting tags: https://codesandbox.io/embed/z4jps3?module=/src/Demo.tsx&fontsize=12

Steps:

  1. Select multiple options such that the textfield grows to more than 2 lines.
  2. While the textfield is still focused, try to click on the clearIndicator in the end adornment slot.

Current behavior

I get mixed behavior. Usually it either loses focus on the textfield, sometimes it closes and reopens the autocomplete drop down.

Expected behavior

If I click the clear indicator, it should clear the text, even when the textfield has focus and the dropdown is opened. See the v5 demo - https://codesandbox.io/p/sandbox/2dhj9z?file=%2Fsrc%2Findex.tsx

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: autocomplete clearIndicator limitTags multiselecct

Search keywords:

@jbrunner92 jbrunner92 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 15, 2024
@MBilalShafi MBilalShafi transferred this issue from mui/mui-x Oct 16, 2024
@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Oct 16, 2024
@AWAIS97
Copy link

AWAIS97 commented Oct 16, 2024

I think this is related to 43978.

@mj12albert
Copy link
Member

Usually it either loses focus on the textfield, sometimes it closes and reopens the autocomplete drop down
@jbrunner92 I can't reproduce this in the sandbox (yet) - when this happens though, does the text (consistently) get cleared or not?

@mj12albert mj12albert added status: waiting for author Issue with insufficient information package: material-ui Specific to @mui/material and removed bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 24, 2024
@mj12albert mj12albert changed the title Autocomplete multiselect clearIndicator not working when focus is on autocomplete and limitTags is set [Autocomplete] multiselect clearIndicator not working when focus is on autocomplete and limitTags is set Oct 24, 2024
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@jbrunner92
Copy link
Author

jbrunner92 commented Oct 31, 2024

sorry, I forgot to respond to this. No, it does not clear the text. The menu closes and opens, which triggers the input to shrink and resize, and the clear button doesn’t trigger for some reason. This definitely did not happen with MUI v5, I even tried it with the same demo on the MUI webpage by toggling to v5, and it definitely was behaving appropriately. It might trigger sometimes, especially if you only have 2-3 lines of options selected when you click the clear button, but keep selecting more values, and the larger the input gets, the less it is likely to work.

Usually it either loses focus on the textfield, sometimes it closes and reopens the autocomplete drop down
@jbrunner92 I can't reproduce this in the sandbox (yet) - when this happens though, does the text (consistently) get cleared or not?

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 31, 2024
@github-actions github-actions bot reopened this Oct 31, 2024
@ZeeshanTamboli
Copy link
Member

Works in the latest version. Fixed in v6.1.5.

@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 12, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@jbrunner92 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

5 participants