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

Strange behaviour on "Enter" #118

Closed
arghav opened this issue Sep 16, 2013 · 9 comments
Closed

Strange behaviour on "Enter" #118

arghav opened this issue Sep 16, 2013 · 9 comments

Comments

@arghav
Copy link

arghav commented Sep 16, 2013

First of all, thanks for the great library.

I'm facing an issue that selectize auto-adds the active element on enter from the dropdown even when the dropdown is closed.

Is it possible to stop this behaviour? I want it to add items on enter only when the dropdown is open.

Thanks!

@brianreavis
Copy link
Member

Hmm, I'm having troubles reproducing this behavior. Do you have some reproducible steps you can share? When the dropdown is closed, Selectize should be clearing the active option.

@arghav
Copy link
Author

arghav commented Sep 17, 2013

Here's the code that has the issue. http://jsfiddle.net/5Rt8X/24/

I've set openOnFocus: true, but when I just return in the input box it adds items. Seems like a bug?

It also opens up the dropdown when I remove an item. Could this be prevented?

Also, unrelated to this but is there a way to not auto-select the options when the user is typing? I would like to give precedence to the "Add xxx..." item.

Thanks. :)

@brianreavis
Copy link
Member

I still can't seem to reproduce the issue. What browser (+ version) are you using? P.s. here's an updated jsfiddle with better js / css links.

Request for configurable precedence for the "Add xxx..." item noted :) I think I can fit that in 0.8.

@arghav
Copy link
Author

arghav commented Sep 21, 2013

I've added a modified jsfiddle. Focus in the field and just press "enter". It will add the next item even when the dropdown is not visible.

I tested it on Chrome and Firefox in OS X. The issue persists.

Also try to remove an item and it will open up the dropdown menu, which is also a bit weird since the options openOnFocus is false.

Also, great that you will add precedence for "Add xxx...". 👍

@brianreavis
Copy link
Member

Ah! Definite bug. I'll get that fixed up.

@arghav
Copy link
Author

arghav commented Sep 21, 2013

Thanks a lot! Cheers. :)

@arghav
Copy link
Author

arghav commented Sep 24, 2013

Awesome! 👍

Will you also update the dist files?

@brianreavis
Copy link
Member

Yep. This will be part of the 0.8.0 release with a good bunch of other improvements. It should come out in the next few days :)

@arghav
Copy link
Author

arghav commented Sep 24, 2013

Yay! :)

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