-
Notifications
You must be signed in to change notification settings - Fork 6.7k
v0.7 problem with typehead + ng-submit + Enter #1298
Comments
@xiehan I hear what you say... and I'm divided here. Let's some more members of the community to weight here. But I can surely consider rolling but this commit if more people are against this change (and honestly, the more I think about it I'm more against it myself :-)) |
Got it. Thanks for the consideration. I can hold off on upgrading anyway, since the v0.7.0 release doesn't seem to make much of a difference in our implementation. I just wanted to add that I think that anything that utilizes either |
Just want to weigh in here. My opinion is that typeahead shouldn't modify any behavior of the input field when the dropdown isn't showing. As such, I think it should only prevent submission only if there are options showing. If this is change is reverted, we can provide a snippet in the Wiki (or somewhere) for those who want to prevent default on enter. Just a simple directive that does preventDefault on keyCode 13 on the keydown event. |
I have a similar issue, if i use the typehead in conjunction with ui-keypress. When type something and press enter, the ui-keypress never gets the enter. |
I also use the typeahead + ng-submit on several inputs on my system and the submit on ENTER is critical to me. So in my opinion the ENTER key should be allowed since it is a default behavior and the users are used to it. |
OK, I think that there is enough weight to remove this commit and this is what I'm going to do. |
@pkozlowski-opensource I was going to post an issue about this, because it is not great in my working scenario: I have a search form using ng-submit like @xiehan, with typeahead giving suggestions. I would like the user to be able to send his/her raw search by pressing enter, when no matches are found or no match is selected.
Imo I would go for a custom directive, default to false, which would prevent submission or not. It also brings me to another discussion: when matches are found, the first item is automatically set to active. Pressing enter selects this first item and doesn't send the form (if inside a form). My average user wouldn't think about escaping typeahead before pressing enter. I think a new directive typeahead-select-first (default to true) would be beneficial. Should I create an issue for this? Edit: I found issue #908 |
👍
|
Hi:
We're currently using the typeahead in conjunction with ng-submit on a form for inputting tags for content. We're using ng-submit because in addition to allowing us to use a regular submit button, it also allowed us to submit the form by pressing Enter, which we consider to be essential since adding tags tends to be a very repetitive operation.
I can see that as per commit 253c49f in the new v0.7.0 this is no longer possible. Other than forking the repo and removing the change which might introduce problems later on, it possible to undo this or get around it so we can use Enter again? This is pretty critical functionality for us, and we never had any problems with the implementation in the old version...
The text was updated successfully, but these errors were encountered: