-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[typeahead] dropdown doesn't hide on blur (ios only) #3699
Comments
Do you know what event gets fired when either of those buttons are entered on the iOS keyboard? |
I did a little investigation using a monkeypatch of UI Bootstrap with this Plunker, and it looks like Safari is not firing any event when one presses tab, shift + tab, >, or <, the latter two being on the iOS keyboard. I am not sure what we can do here, since it looks like an iOS Safari bug. We can however catch the enter keypress, since Edit: On further investigation, it looks like we can listen for the blur event. Edit 2: It looks like enter is behaving as it should on the iOS keyboard. |
Wesley, I forked your plunkr and tried a little fix. element.bind('blur', function (evt) {
resetMatches();
scope.$digest();
}); Tested again on iOS, works great for me. |
I took a look at your suggestion with a re-addition of your variable, and it breaks expected behavior of selecting the highlighted item on the iOS Simulator in Safari for the iPhone 6. |
Hi, For example, if I type "Martin" and my list contains "Martino" and "Martina", using "<", ">" or "OK" on iOS leaves the dropdown visible. Here is how I solved it: element.bind('blur', function() {
if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {
selected = true;
scope.$apply(function() {
scope.select(scope.activeIdx);
});
}
if (!isSelectOnBlur && isEditable && scope.matches.length && scope.activeIdx == -1 && !selected) {
resetMatches();
scope.$digest();
}
hasFocus = false;
selected = false;
}); The purpose is to reset the dropdown content if editable and nothing's selected. |
Linking for reference here for investigation on another Mac since Apple seems to have no regard for iOS Simulator on the Macbook Air. |
Can you post a reproduction via Plunker - not seeing this at all. |
Closing due to lack of being able to reproduce this - feel free to file a new issue if this is still a problem. |
I believe this issue should not closed (or something has been changed to break the fix since it was fixed). The typeahead dropdown stays open on iOS on a blur event triggered by using the "<", ">" or "Done" buttons on the keyboard. You can see this behavior on the typeahead example on the angular-ui site. fairly hacky work around that gets the job done and doesn't appear to disrupt anything else is to add the following to the bottom of the blur event binding:
|
Hello, When typeahead is opened on a iPhone (safari) you can click any where on the page it doesn't closed. Steps to reproduce the issue: Version of Angular, UIBS, and Bootstrap Angular: 1.6.1 UIBS: 2.5.0 I've noticed that it is working on the demo website (dropdown close when clicking elsewhere on an iPhone): Would you know why it is not behaving the same on the jsfiddle ? |
Hi,
when using the typeahead component in a form with multiple fields, the dropdown doesn't hide when the field looses focus.
This only occurs on ios (safari and uiwebview).
Steps to reproduce:
Expected behavior:
The dropdown should be hidden as soon as the field looses focus, even if no dropdown value has been selected (to allow custom values).
The text was updated successfully, but these errors were encountered: