MDL-51919 forms lib: Autocomplete doesn't hide prematurely.

Quickly navigating via the keyboard to an autocomplete
element and hitting down would result in the selections
being displayed and then quickly removed. This has now
been fixed.
This commit is contained in:
Adrian Greeve
2015-10-28 14:15:26 +08:00
parent e360ff5db6
commit 527bde6e0f
2 changed files with 6 additions and 4 deletions
File diff suppressed because one or more lines are too long
+5 -3
View File
@@ -585,10 +585,12 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
window.clearTimeout(closeSuggestionsTimer);
}
closeSuggestionsTimer = window.setTimeout(function() {
if ((e.type == 'blur') && tags) {
createItem(inputId, suggestionsId, selectionId, multiple, originalSelect);
if (e.type == 'blur') {
if (tags) {
createItem(inputId, suggestionsId, selectionId, multiple, originalSelect);
}
closeSuggestions(inputId, suggestionsId, selectionId);
}
closeSuggestions(inputId, suggestionsId, selectionId);
}, 500);
});
var arrowElement = $(document.getElementById(downArrowId));