fix(typeahead): close dropdown on tab with focus-first="false"#3340
fix(typeahead): close dropdown on tab with focus-first="false"#3340dlukez wants to merge 1 commit intoangular-ui:masterfrom dlukez:fix-focus-first-tab
Conversation
|
This is good stuff. I'd actually add the same behavior for the Enter key press, since it is basically the same issue in my opinion, i.e. the user has no intent in modifying the input anymore, either because he changed to a different input by pressing Tab or because he wants to submit the form by pressing Enter. Either you can add this or I'll do a pull request with that change later on if my opinion is not shared. |
|
This is mostly there, just fix those two things up :) . |
|
@wesleycho I deliberately left the == comparisons as they were. I'm not sure of the ramifications of changing them... Perhaps somewhere they are being set as strings and the coercion is necessary? I don't think they should be changed as a part of this PR, since this PR is concerned with fixing the issue mentioned above rather than refactoring existing code which will carry more risk of introducing a bug. |
|
@fernandoneira I agree with you, however the comment suggested this was by design. If others are in support, I'd be happy to make it work like this for the "enter" keypress too. |
|
I will be merging this shortly, along with the change to |
When an item isn't selected and you hit "tab", the dropdown stays open even though the focus moves to the second field. An alternative solution might handle this using the 'blur' event. Happy to discuss this.
See this plnkr: http://plnkr.co/edit/zR0HYGVSlMdLgRvCEIZv?p=preview