-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Handle ctrl/meta keys for datatable multiple selection #794
Comments
This is the commit that the functionality was dropped: I would be curious to know why this functionality was dropped. |
I see now that it was dropped at the request of a user (#284), but that seems like a strange move to not have made that behaviour optional. As far as I can tell, toggling a selection in a table without the use of the ctrl key is very non-standard. Having to individually click on every selected element to turn them off is a pain, instead of being able to simply click on one to reset the multiple selection. |
PrimeFaces uses the approach you've described, at PrimeNG we've changed it to be more mobile friendly as there are no shift or metakeys, but we are open to suggestions such as customizable behavior with an attribute to choose between behaviors although it'll make it complex. |
I wasn't thinking about mobile, and I can see now why you would need a simple click-based selection mode in that case. In our case though, we really need the selection to behave like a desktop app, and we have an outstanding story to bypass the datatable's selection logic and handle the Shift and Ctrl/Meta keys ourselves in onRowClick events. We haven't gotten to it yet, and obviously, it would be nicer if the datatable offered that functionality as an option. It already has so many (useful) options that one more wouldn't make it more confusing. Can you see that as something that could be added soon-ish, or should we go ahead with our plans to write our own selection logic? (Something we expect to get to around mid to late September) |
I think we can introduce an attribute to configure this behavior for sure in 1.0 final due end of october. |
That would be awesome! Thanks! |
I am considering to switch to the primeng DataTable (because mostly it is quite awesome!), but would definitely require this feature (the desktop version). Is this still planned for 1.0 final, and what is the expected release date for this? Thanks! |
We've decided to enable key based multiple selection by default and on touch enabled devices, switch to tap based multiple selection targeting RC4. So it depends on environment. |
We left the shift for post 1.0 but the behavior is implemented now, tap for mobile and metakey-ctrlkey for others. |
In our near future roadmap. |
can multiple sorting work also without the metakey pressed? |
Right now, when using the multiple selection mode of the datatable, groups of rows can only be selected/unselected by left clicking on them, instead of using the more standard methods of selecting a range of rows with the shift key, and selecting/unselecting single rows with the control key. The current system is very confusing for anyone used to multi-selection in just about any other UI widget.
I see that as of fix #109, the datatable code was still handling the ctrl/meta key (but not the shift key), but strangely, that was dropped since then in favor of simply toggling the selection on single rows on and off on a click.
It would be useful to have that back, as well as adding handling for a range of rows with shift-clicking. Along with those changes, clicking on an already selected row should never deselect it, but should deselect any other selected rows.
The text was updated successfully, but these errors were encountered: