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

[material-ui][joy-ui][base-ui][Autocompelte] Highlighted index is broken when inserting new item #41386

Closed
CGNonofr opened this issue Mar 6, 2024 · 3 comments · Fixed by #41306
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy package: material-ui Specific to @mui/material

Comments

@CGNonofr
Copy link
Contributor

CGNonofr commented Mar 6, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/mui-autocomplete-bug-94thpd?file=%2Fsrc%2FApp.js

Steps:

  1. As soon as the component appears, press the bottom arrow to select the first item (Pulp Fiction)
  2. Wait 3 seconds for an additional item to appears at the top (The Godfather)
  3. Press the top arrow to select the new item

Current behavior

The last item (The Shawshank Redemption) is now selected

Expected behavior

The first item (The Godfather) should be selected

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

@CGNonofr CGNonofr added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 6, 2024
@danilo-leal danilo-leal changed the title [Autocompelte] Highlighted index is broken when inserting new item [material-ui][Autocompelte] Highlighted index is broken when inserting new item Mar 6, 2024
@danilo-leal danilo-leal added package: material-ui Specific to @mui/material component: autocomplete This is the name of the generic UI component, not the React module! labels Mar 6, 2024
@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 7, 2024
@ZeeshanTamboli
Copy link
Member

It's a bug. I also observed that it only occurs when the option is added to the beginning of the list.

@1CUNHA1
Copy link

1CUNHA1 commented Mar 8, 2024

hey, is this bug still open?

@ZeeshanTamboli
Copy link
Member

hey, is this bug still open?

No. A PR was opened to fix it - #41306

@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Autocompelte] Highlighted index is broken when inserting new item [material-ui][joy-ui][base-ui][Autocompelte] Highlighted index is broken when inserting new item Mar 8, 2024
@ZeeshanTamboli ZeeshanTamboli added package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy package: material-ui Specific to @mui/material
Projects
None yet
4 participants