-
Notifications
You must be signed in to change notification settings - Fork 822
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
Support for selectableCount to limit count when using selectable: "highlight" #3590
base: master
Are you sure you want to change the base?
Conversation
Hey @harbulot Sorry for the delay in getting back to you on this one, between the website rebuild and the 5.2 release I've rather had my hands full. Thanks for submitting a PR, it is always great when a member of the community wants to contribute! The highlight functionality is mainly used to highlight a row on hover and doesn't directly affect selectability in any way:
Could you explain a little more about your usage case as I don't quite follow what this would be used for? Im not averse to having a I would also be looking to change the name, as i would consider a count to be an action, in this case we are setting the maximum number of selectable rows, so the property name should reflect that. Cheers Oli :) |
Hi @olifolkerd, thank you, no worries, I'll try to explain a little better. What I was trying to achieve was to be able to both:
Without this patch, setting a max number via
The
I'd like to have (2) without (1), which I'd replace with checkbox-based selection only. Please let me know if this makes more sense (or not :-) ).
You're right, I was just drawing the max value from
Sure, that makes sense, maybe Thank you! |
Thanks for the more detailed response that makes sense. From a UX perspective how would you manage the checkbox elements when the maximum selections has been reached? In terms of name maybe something like There would be no problem with the functionality changing, this would have to be included in a minor release anyway which would come with an upgrade guide explaining to users how to manage it. what i would normally do is add a Cheers Oli :) |
Hey @harbulot Are you still interested in pursuing this, or should i close the PR? Cheers Oli :) |
072645b
to
09929a8
Compare
Hi Oli, Apologies for the delay! I've updated the PR, using I've updated the demo example too.
At the moment, it's using the behaviour that was already implemented in Please let me know if you have further comments, thank you! |
Hi Oli,
(I wasn't sure if you'd rather discuss in an issue first or see the PR directly, but I'll try to describe the issue in the PR.)
This is a new feature request. The purpose is to separate the logic of being
selectable
(specifically just"highlight"
) from the numerical limit (max number of selectable rows).Here are a couple of live examples:
selectableCount
.Essentially, in cases where the selection is made using a checkbox, it can still make sense to use
{ selectable: "highlight" }
.(I think this use-case can be a bit less confusing sometimes for the user, especially when they have other reasons to click somewhere within the row: e.g. editors or tree collapse/expand symbols to click on also within the row.)
Unless I'm mistaken, at the moment,
{ selectable: "highlight" }
implies that there is no max number of selected rows: you can't usehighlight
and also have a single row/checkbox selected at most.What I'm suggesting is an additional
selectableCount
parameter, which can take a numerical value to limit the count when usingselectable: "highlight"
(and checkboxes, typically).When it's not specified, the current behaviour of the
selectable
option should still apply. (AlsoselectableCount: true
would mean an unlimited number of rows, which is already the default withselectable: "highlight"
anyway.)I hope this makes sense. Thank you!