-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
clear_button plugin #1303
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
clear_button plugin #1303
Conversation
Changes Unknown when pulling a5d61d2 on Koloto:clear_button into ** on selectize:master**. |
@brianreavis, @joallard Any chances to merge this PR? |
e.stopPropagation(); | ||
if (self.isLocked) return; | ||
|
||
self.clear(); |
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.
clear() will not trigger the 'item_remove' event (see pull request: ea2e931#diff-a1e04fdc9fa0888b83d5b5401328081bR62)
Maybe it is on purpose, but just wanted to mention it, in case deleteSelection() is more appropriate.
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.
Actually clear()
already triggers the event clear. And that might be enough.
Having the item_remove event being triggered automatically would be just convenience; probably one should listen on("clear item_remove")
in case of wanting to execute the same callback for both events.
E.g. using the same callback for settings onClear
and onItemRemove
will achieve that.
Additionally, deleteSelection
provides support for the onDelete
callback, that is an actual useful feature (validate values before removal and eventually prevent the clear/remove operation).
I believe this should be still supported also when clearing or removing items (so that we can stick to what said in the previous paragraph).
Except for that: thank you for the plugin :) |
|
Also, feel free to comment back my pull request, if you think is wrong! 👍 |
I would add some insights (useful for my pull request and for this one as well), coming from reading code and tracing the commit history: There are some evidences, in the repo history, that Also, Note: this is not directly related to this pull request, but I wanted to leave a trace for when the above mentioned details will be implemented/fixed. |
Stale pull request message |
The plugin adds a small cross on the right which clears all items (while
remove_button
plugin removes only one item).