Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

create function triggered twice when "Add...option" is clicked on #2037

Unanswered
jcraw62 asked this question in Q&A
Discussion options

With v 0.15.2 the create function is triggered twice if instead of hitting enter you mouse click on the "Add...option" label.

Is this a bug? Is there a work-around?

Maybe the real question is is "Add...option" selected so that enter should work (and click merely re-selects the new option with no effect)

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

I found a solution for that version (0.15.2)

Go to this line of code:
$dropdown.on('mouseup click', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); });

Remove the "mouseup":
$dropdown.on('click', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); });

Works!

You must be logged in to vote
1 reply
Comment options

This works <3. Just to be explicit, this change must be performed in whatever file holds the code for selectize. If a minified version of the code, you'll see something like this

r.on("mouseup click","[data-selectable]",function(){return e.onOptionSelect.apply(e,arguments)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /