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

Using arrows may leave inconsistent value in the input field #521

Open
marcelosramos opened this issue Jun 15, 2018 · 1 comment
Open

Using arrows may leave inconsistent value in the input field #521

marcelosramos opened this issue Jun 15, 2018 · 1 comment

Comments

@marcelosramos
Copy link

Hi again,

I have this other issue when navigating with the arrow keys: given I enter the input for the first time and I go down with the arrow down key, when I go back all the way up with the up key (until currentIndex gets to -1), then the value of the input do not clear out, it keeps the first item's value. So I see a value in the input field, but the selectedObject does not reflect that, I can't even catch it from the input-change function.

If I've typed in anything or selected any item before (even if I delete it all and set the input field to empty again), then the behaviour is what I expect, when I get all the way up, the input value goes back to what was there before.

This issue happens because of this code in line 397: inputField.val(scope.searchStr);. If I didn't type anything then scope.searchStr is undefined, and input.val(undifined) just doesn't do anything.

So, if scope.searchStr is previously initialised with null or '', or the line is replaced with inputField.val(scope.searchStr || '');, then the problem is solved.

@marcelosramos
Copy link
Author

This only happens when minlength="0"

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

1 participant