Closed stnor closed 8 months ago
I have wondered a while ago if there was a use case for a "before:select" event, and couldn't think of anything which would require it. Now here it is.
As an alternative to hard-coding this specific behaviour into Backbone.Picky, a limit could be implemented in an onBeforeSelect
event handler. That kind of solution would be a little more flexible. There'd have to be a cancelSelect
flag of some kind, which an event handler can set, presumably on an options object which MultiSelect.select
has access to. Just a thought.
I added support to limit the number of selections that can be made in a MultiSelect. Not sure if this is useful to anyone else, but here goes.