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] Make touch and click behavior on an option consistent #37972

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

divyammadhok
Copy link
Contributor

@divyammadhok divyammadhok commented Jul 15, 2023

fixes #37848

Description

Here the bug on mobile devices was due to the fact that we were calculating and scrolling the element / option into the view before selecting it, which selected an incorrect element.

I have made the functionality consistent with what is present in mobile devices.

Demo: https://codesandbox.io/s/nice-bush-mqzcpf?file=/demo.tsx

@mui-bot
Copy link

mui-bot commented Jul 15, 2023

Netlify deploy preview

https://deploy-preview-37972--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against a48959f

@zannager zannager added the package: base-ui Specific to @mui/base label Jul 17, 2023
@michaldudak michaldudak changed the title [base] MUI-37848: Make touch and click behavior on an option consistent [Autocomplete] Make touch and click behavior on an option consistent Jul 17, 2023
@michaldudak michaldudak added the component: autocomplete This is the name of the generic UI component, not the React module! label Jul 17, 2023
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for the fix!

@michaldudak michaldudak merged commit 8653517 into mui:master Jul 17, 2023
19 of 20 checks passed
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: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocomplete with grouping not selecting correct item on touch
4 participants