[Autocomplete] Prevents Autocomplete menu from opening on right click#47797
[Autocomplete] Prevents Autocomplete menu from opening on right click#47797silviuaavram wants to merge 2 commits intomui:masterfrom
Conversation
Netlify deploy previewBundle size report
|
There was a problem hiding this comment.
Pull request overview
This PR prevents the Autocomplete menu from opening when the user right-clicks on the input field. It addresses issue #36075 by adding a check to ensure only left-click (button 0) triggers the popup indicator in the handleInputMouseDown handler.
Changes:
- Added
event.button === 0check tohandleInputMouseDowninuseAutocomplete.jsto filter out non-left clicks - Added a test case to verify right-click doesn't open the popup
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/mui-material/src/useAutocomplete/useAutocomplete.js | Added button check to prevent right-click from opening the autocomplete popup |
| packages/mui-material/src/Autocomplete/Autocomplete.test.js | Added test to verify right-click behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ZeeshanTamboli
left a comment
There was a problem hiding this comment.
This works well but I think the input should also be focused when right-clicking on the border of the input like in Base UI Combobox: https://base-ui.com/react/components/combobox.
|
Are you sure? I right clicked everywhere, including on their border, and it's not opening. And it shouldn't. |
I mean input should be focused on right click, and not the pop-up should be opened. |
|
Oh I see. This is a different issue. We can fix it separately, since it doesn't seem to be a breaking change. |
Alright. |
siriwatknp
left a comment
There was a problem hiding this comment.
Breaking change should be added to the upgrade-to-v9 page.
95d728c to
61e718c
Compare
It's basically #36389 from @taverasady but opened this one instead because of rebase/merge issues.
Fixes #36075