-
Notifications
You must be signed in to change notification settings - Fork 540
Angular 1.5.0 and autocomplete [enter] keypress not working #638
Comments
I'm experiencing this as well, having also commented on #625 For me, it seems to be caused by a change in the registration order of the input-keydown event on both the editor and the autocomplete dropdown; the order has been reversed in Angular 1.5. This causes the editor to receive the ENTER key press before the autocomplete dropdown, closing the dropdown and simply creating a tag based on the partial string you've typed (just as it would if the autocomplete dropdown wasn't being used). |
I've created a Plunker which reproduces the issue: http://plnkr.co/edit/1ekFvs?p=preview |
Add a $timeout delay to tagsInput so that it always registers its event observers last, allowing autoComplete to register first, which is required for correct behaviour. Closes mbenford#638.
PR added with potential fix. |
@duncangrist while your PR fixed the [enter] keypress if I hit [tab] to select the autocomplete selection it adds my selection [fake name x] and an empty tag [x] with my first tab selection only once. If I try to hit tab again it all works as expected but with a small delay. Thanks for looking into this! |
@dkomando, I can't reproduce that behaviour in either my app, or the test-page which comes as part of the ng-tags-input project. Perhaps I'm misunderstanding you but, if I type a few characters of a tag, select the correct entry in the autocomplete drop down using the cursor keys and then hit [tab], the entire tag is correctly substituted into the editor with no discernible delay that I could notice. I've uploaded a short video of me doing this here: |
@duncangrist, Here is what it looks like on the latest version of Chrome on the Mac. I hit [enter] for the first one and [tab] every time after. I also now see that I can't add more than a couple without it being added but hidden. Once I have entered all that are available I click in the box and start hitting [backspace] after a while it finally reaches the view able tags and deletes everything in the input. https://drive.google.com/file/d/0B6a7QRHsq93oM0tBMDZiOVBtc0k/view?usp=sharing My basic controller that I am using: |
That does indeed look very strange! I've created a new Plunk with your controller implementation, and I still can't reproduce... Thinking it may be something else about your application environment? Can you edit that plunk to a point where it behaves like your video? |
Actually your Plunker works perfect for me so must be something I setup wrong. Going through your Plunker now to see what is making the difference. |
I have the same issue... here are two examples try to enter 'tag' and hit Enter. You'll get 2 different behaviors. I tried Chrome and IE - the same issue |
...and in FF also |
Just use 1.4.9 and it works fine. |
Sorry, but I use components which aren't supported in 1.4.9 |
Same issue here, running Angular 1.5 |
angular 1.5 is the main issue. any idea how to fix it without modifying the plugin. |
I too am hoping for a fix soon. I am assuming its a change in the way the enter event is triggered on the autocomplete suggestion. It seems to me the enter event is being triggered on the input rather than the match. |
@mbenford Can you please have a look at this issue? |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
setting add-from-autocomplete-only="true" in tags-input tag worked. |
@mbenford How to obtain these commits through bower? |
@mbenford that change works a treat, any plans on a new version being released (npm, bower, zip)? |
@shyamal890 @davidamitchell I'll try my best to release a new version on all distribution channels later this week. But the latest build generated by Travis is always available to download. |
@mbenford thanks that is good to know, I had assumed that was the 3.0.0 version. downloading now.... |
+1 Would love to have this fix available in bower. Thanks @mbenford |
any word on when the fix will be available on npm? |
no news 2016-05-25 21:21 GMT+02:00 Lenny Kean [email protected]:
Cordialement, Alexis Momcilovic - www.momcreation.fr |
...still waiting... k thx bye |
Just so you guys know, version 3.1.1 has been released earlier today on all distribution channels. v3.1.0 has a bug that affects applications using Angular prior than 1.5.x, so don't use it. |
Pressing the [enter] button no longer selects the highlighted entry using Angular 1.5.0.
However, [Tab] still seems to work fine but [enter] ends up closing the suggestionList before the plugin is able to select the highlighted option in which it only makes what was typed in the entered tag.
I have confirmed this on Mac FF & Chrome.
The text was updated successfully, but these errors were encountered: