-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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][Autocomplete] Options list scrolls to the top if more options are added after pulling the scroll handle to the bottom #40250
Comments
I'm experiencing the issue intermittently in your CodeSandbox reproduction: Autocomplete.scroll.to.top.mp4It mainly happens when the cursor remains on the scrollbar after dragging the scroll handle to the bottom. |
@ZeeshanTamboli I have the same issue. Reproduce link https://codesandbox.io/s/autocomplete-scroll-bug-39wfv |
@mj12albert @ZeeshanTamboli I have the same issue. Reproduce link https://codesandbox.io/s/autocomplete-scroll-bug-39wfv I have the last version of the MUI with the same behaviour how in this reproduce link |
@ZeeshanTamboli Is there any update on this? When can we expect a fix for this? |
@NjegosR Currently, I don't have any updates to share since I am not working on it. However, this issue is open for contributions from the community. Your assistance or insights would be greatly appreciated. |
This scroll resetting was added intentionally by #23718. It only checks if the currently highlighted option is still in the list. When there is no highlighted option, the scroll will always be reset when the length of filtered options changes. |
A workaround is to set |
It's not working for me, probably because I'm creating my custom paper component. Is there a different workaround? |
There's another report of this: #43954 I case anyone that stumbles upon this and is trying to achieve virtualization, we have an example for that: https://mui.com/material-ui/react-autocomplete/#virtualization. I'll add it to the Material UI with Base UI milestone, as I think we can fix it when we refactor on top of Base UI's autocomplete (whenever that is released). |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/p/sandbox/dark-dust-zdlhtj?file=%2Fsrc%2FDemo.tsx%3A29%2C18
Steps:
Current behavior 😯
When manually scrolling to the bottom of an infinite-scroll options list, if the user scrolls too fast with the scroll handle the list will jump to the top as soon as data finishes loading.
Expected behavior 🤔
Scroll position should not change, as observed when scrolling with other methods.
Context 🔦
Our QA team discovered this edge case when testing that #30249 was resolved in our product. The effect is a potentially degraded user experience when using infinite-scroll autocompletes.
Your environment 🌎
npx @mui/envinfo
Observed using latest Chrome.
The text was updated successfully, but these errors were encountered: