-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[autocomplete] Fix ArrowLeft, Backspace & Delete behavior for multiple and single-value rendering with proper caret handling
#47411
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
base: master
Are you sure you want to change the base?
Conversation
- Only select chip/value when cursor is at start of input (position 0) - Makes multiple mode consistent with single mode behavior - Fixes mui#47241
Netlify deploy previewhttps://deploy-preview-47411--material-ui.netlify.app/ Bundle size report
|
TBH I don't really understand this, do you press ArrowLeft when the input is already focused? Would appreciate a screen recording if possible |
@mj12albert Yes, it happens when the input is focused. By “value,” the author meant the selected value Chip. The behavior in the fix matches Base UI Combobox: https://base-ui.com/react/components/combobox#multiple-select (which I suppose is ARIA compliant). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnbain Thanks for the PR. Some existing tests are failing that can be checked in CI.
|
I think the change is fine, though I don't think this behavior is specified in ARIA
The issue is this, assuming it's referring to https://mui.com/material-ui/react-autocomplete/#single-value-rendering The behavior seems buggy as you can't move the caret through the whole text, it just jumps from the end to the chip So I suppose it's not that the behaviors are inconsistent between single/multiple but they each have their individual bugs |
ArrowLeft behavior in multiple mode with input text
…ub.com/jnbain/material-ui into fix-autocomplete-arrowleft-issue-47241
ArrowLeft behavior in multiple mode with input textArrowLeft behavior in multiple and single value rendering mode with input text
ArrowLeft behavior in multiple and single value rendering mode with input textArrowLeft, Backspace and Delete behavior in multiple and single value rendering mode with input text
ArrowLeft, Backspace and Delete behavior in multiple and single value rendering mode with input textArrowLeft, Backspace & Delete behavior for multiple and single-value rendering with proper caret handling
|
@jnbain Made the expected changes, including fixes for Backspace and Delete. I have also added tests. @mj12albert would you mind reviewing? |
Fixes #47241
Checklist
masterPreviews: