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] options list keeps jumping/scrolling back up when disableCloseOnSelect and multiple is set #20388

Closed
2 tasks done
danielkalen opened this issue Apr 2, 2020 · 7 comments · Fixed by #20315
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@danielkalen
Copy link

When you have a multi-value autocomplete component and have also set the disableCloseOnSelect, a weird jump/scroll back to the first selection occurs.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When multiple and disableCloseOnSelect are set to true, upon selecting new options in addition to previously selected options the scroll box of the options list will jump/scroll back up to the first selected option.

Expected Behavior 🤔

The list's scroll state should remain exactly as is and should not scroll back up upon selection.

Steps to Reproduce 🕹

I went to the Autocomplete demo docs and have forked the multiple-values demo section.

Demo: Demo
Codebox link: https://codesandbox.io/s/material-demo-weo4b

Steps:

  1. Go to Autocomplete demo docs
  2. Scroll down to multiple-values section, fork the example in codesandbox.io
  3. Add disableCloseOnSelect to one of the autocomplete fields
  4. Add mutiple selections and watch how the lists jumps back to the first selected option.
Tech Version
Material-UI v4.8.0
React v16.11.0
Browser Canary Latest
@oliviertassinari
Copy link
Member

Thanks for reporting this regression, #20315 was meant to solve it but it seems it didn't far enough.

@oliviertassinari
Copy link
Member

Actually, #20315 wasn't released yet.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! component: autocomplete This is the name of the generic UI component, not the React module! and removed component: text field This is the name of the generic UI component, not the React module! labels Apr 2, 2020
@oliviertassinari

This comment has been minimized.

@oliviertassinari

This comment has been minimized.

@mui mui locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@oliviertassinari @danielkalen and others