-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Select] Allow range selection using shift key #21753
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@material-ui/core: parsed: +0.14% , gzip: +0.18% |
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.
Thanks for working on this issue! We need some tests for this feature though. Like selecting (multiple) options, deselecting (multiple) options, shift-key for mousedown and keydown etc.
Could you explain why you went with Shift instead of Ctrl as the modifier key?
@eps1lon Will work on adding tests. Found in the web something that might put my thoughts in better words: |
Thanks. It wasn't clear to me that you implemented range selection. |
@eps1lon Is that something you guys want to push or wait with it? |
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.
@eps1lon Is that something you guys want to push or wait with it?
GitHub notifications are quite noisy so the occasional requested review slips through.
Some missing tests/assertions:
aria-selected
state of eachoption
after shift-select- shift-click on non-multiple select i.e.
<Select />
Keyboard support should go into the minimal implementation. Bolt-on a11y is usually harder than planning a feature with a11y in mind from the start.
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.
Do we really need to implement the range feature, like the one we have with the tree view? It seems that such behavior will be frustrating considering how easily the popup can close. What about we aim for simplicity?
- We change the Select multiple behavior to close when a value is selected (consistency with Autocomplete): [Select] Consistency with Autocomplete #18136.
- We restore the current multiple "keep popup open when value selected" behavior when the ctrl or meta keys are pressed. Matches select2, requested in [Autocomplete] Don't close the popup when Ctrl/Shift clicks #19654.
Native select has it built-in. The purpose of a custom Select is to have a customizable native select. I haven't seen a custom Select that's worth giving up native UX.
Seems like we have an issue with the close trigger.
What makes the Autocomplete the source of truth for perfect UI here? This argument is not constructive. Why not implement this behavior in Select and Autocomplete instead?
This PR is about range-selection with SHIFT not arbitrary multi select with CTRL. |
I was wondering about the requirement for it as, so far, the custom multi-selects or combo boxes I could benchmark don't have it. I don't know if it's because most people don't ask for it, or if it's because the UX isn't great or because it's too costly/hard to implement. Do we have an opportunity to abstract the ctrl, meta multi-selection into a hook, and share it with the Autocomplete? It's the 4th time I encounter this potential need: 1st time at onepixel for an image gallery, 2nd for the tree view, 3rd time for the select, 4th time for the autocomplete. |
Or because users can't rely on the same UX between pages because every component looks (basically) the same but works different. Falling back to multi-click select after shift click is most likely not measured because most devs are ignorant about the existence of shift-select in UIs.
Benchmarking is a misleading technique to collect requirements. This is one of the many reasons. |
Very possible, I find this argument convincing. My assumption is that the request vs cost ratio is low, making this feature a high opportunity cost for the design system teams in the industry.
I was using the following reasoning: by the absurd. We are in a mature industry with a lot of legacies. Let's assume the range feature is something important, then we should see it implemented in at least a couple of popular web interfaces, users being used to it. If it's not the case, then it means that the UX/UI/developer teams out there have better problems to solve. Also, assuming our aim is to replace these teams, we should have priorities close to them. Hence, it's probably not a feature we should value a lot. |
@dvh91 We appreciate the contribution, however, it has been stale for a while now. If you want to push forward with it, I would recommend moving the logic to the combo box (Autocomplete). The current UX of our Select component is not as great as it could be. The issues I can remember without looking at the issue history:
|
Hi guys, Hope I find you well! Can I ask if this problem was ever solved or will be looked at again? My original request was #5302. I would have thought the shift/range select option would be useful - it would certainly reduce the risk of RSI that people like me are currently facing from constant mouse clicking to select things. Many thanks! Henry |
would the work on this feature ever finished? very important behavior. Or can you give me some tips on how can i customize autocomplete to implemet it myself? |
@Emilname The feature is available on the Autocomplete. Could you confirm? Does it solve your issue? |
@oliviertassinari sorry for pinging! I just checked Autocomplete and tried shift + click (and cmd + shift + click) on the multiple value example and it didn't select the range. Or by feature did you mean that now Autocomplete menu won't close when you do cmd + click or ctrl + click, and we still need to implement our own range click? Thanks so much! |
@tihuan Right, there are two different dimensions here:
|
Got it! Really appreciate the clarification 😀 Have a wonderful day! |
@oliviertassinari I see that you said
Does that mean that this kind of behavior will never be built in? |
I've added a feature to the
Select
component (multiple-values variant) which allows the user to use the shift key in order to select multiple options.