Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Conversation

mxposed
Copy link

@mxposed mxposed commented May 29, 2012

createTokens setting allows the creation of new token on enter.

The bug fixed was that if you have set selected_dropdown_item and then type another character and then quickly press enter you would get an error pointing to the add_token function with item being undefined.

@anuragphadke19
Copy link

Thanks a lot for this added functionality. +1 for pulling this into the original.

@johnlcox
Copy link

johnlcox commented Jun 3, 2012

It looks like the createTokens setting only allows adding tokens when no autocomplete results are found. However, if someone doesn't like any of the autocomplete results and would like to add a new token instead it will force them to select one of the available options.

@mxposed
Copy link
Author

mxposed commented Jun 4, 2012

johnicox: yes, this is intended. Otherwise it would be ambiguous what token the user wants. So the user should dismiss the autocomplete with escape and then press enter or comma to create the token

@ozzyogkush
Copy link

I hope this gets pulled in, seems to be working great so far. Thanks for fixing that add_token bug, that was very frustrating.

@duro
Copy link

duro commented Jun 14, 2012

Let's get this baby pulled in...I think many people need this feature.

@micred
Copy link

micred commented Jun 18, 2012

+1

@ches
Copy link

ches commented Jun 25, 2012

#219 takes a different approach to the ambiguity matter -- it displays a "what-you've-typed (Create new token)" entry in the menu so it can be chosen. The text is configurable. The callback hook that that pull req includes is a nice addition as well.

Though there is still room for improvement (would be nice if pressing comma was a shortcut to selecting the "create new" entry, for instance), personally I think that approach is more intuitive for the user than what @mxposed proposed above. Ideally both could be supported, so that if I do happen to dismiss the menu but then press comma, that should also create the token (if what has been typed so far isn't a duplicate).

@mxposed mxposed closed this Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants