Closed koktaildotcom closed 6 years ago
@almothafar can you look at the pr please?
Thanks for PR, I'm just worried about breaking the correct behavior of this component, I mean when the list opened, and I select the item with arrows, and click enter to select, does your BR breaking this and force me to click instead? if yes, then I'm not going to merge this, because it will simply create a new issue.
Thanks for your reaction @almothafar. The PR is not breaking the correct behavior of the select list. The code keeps track of current state of the input
with the selectOnEnter
variable.
In your scenario:
selectOnEnter
= false
on default.
On arrow up
(or arrow down
) the event will be triggered and set selectOnEnter
to true
if the enter
is triggered now, the item is selected.
On hideDropdownList
the selectOnEnter
will be set to false
so the enter
event (without the autocomplete list open
) will not return the item.
I've already have this code running on a production environment.
Sounds good. I'll merge it but it will be released next version.
resolves https://github.com/ng2-ui/auto-complete/issues/340