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

Entering in special chars in the search field cause it to select first category #103

Open
schaitanya opened this issue May 16, 2013 · 1 comment

Comments

@schaitanya
Copy link

Steps to create:

  1. Type 8.25% in the text field. (You can also just type any special char anywhere like $ etc and hit enter)
  2. The text will disappear and the first category will show with empty value.

Expected behavior

  1. Show the entered text under 'text' category.

This can be seen on the demo page

@mewynn
Copy link

mewynn commented Jul 10, 2014

You can fix this bug yourself :

The problem is autocomplete menu is displayed if a category match the last word or if last word is empty. The regx that match last word in code doesn't work properly.

Just replace :
var lastWord = searchTerm.match(/\w+?$/); // Autocomplete only last word.
by
var lastWord = searchTerm.match(/[^\ ]
$/); // Autocomplete only last word.

on autocompleteValues function on SearchInput definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants