Skip to content
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

Add option for confirmation on item delete. #1

Closed
brianreavis opened this issue Dec 7, 2012 · 3 comments
Closed

Add option for confirmation on item delete. #1

brianreavis opened this issue Dec 7, 2012 · 3 comments

Comments

@brianreavis
Copy link
Member

Right now it's really easy to accidentally delete items... in some cases this is great (tagging), in other cases this is bad.

@wmartins
Copy link
Contributor

wmartins commented Jun 6, 2013

What is the best way to do that?

I think we have to create a function called onDelete (maybe just delete). This function will be called when deleteSelection is called (if the onDelete function exists). If returns true, the element is deleted.

This will allow to define custom delete functions.

@brianreavis
Copy link
Member Author

I think that's a good, customizable way of doing it ("onDelete" handler). However, I think !== false would be a safer condition. This way it'd behave identically to how normal event handlers behave. Return false to cancel, otherwise go through with the action. Yeah?

@wmartins
Copy link
Contributor

wmartins commented Jun 6, 2013

I agree!

brianreavis added a commit that referenced this issue Jun 9, 2013
Confirmation on item delete(#1)
sg00dwin pushed a commit to sg00dwin/selectize.js that referenced this issue Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants