MDL-59365 autocomplete: Keep the suggestions open

If the list allows multiple selections, don't auto-close the suggestions list
every time something is chosen.
This commit is contained in:
Damyon Wiese
2017-07-11 13:47:28 +01:00
committed by Dan Poltawski
parent a60e8ba51e
commit 786e014c5c
2 changed files with 13 additions and 5 deletions
File diff suppressed because one or more lines are too long
+12 -4
View File
@@ -450,10 +450,18 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
updateSelectionList(options, state, originalSelect);
// Notifiy that the selection changed.
notifyChange(originalSelect);
// Clear the input element.
inputElement.val('');
// Close the list of suggestions.
closeSuggestions(state);
if (!options.multiple) {
// Clear the input element.
inputElement.val('');
// Close the list of suggestions.
closeSuggestions(state);
} else {
// Focus on the input element so the suggestions does not auto-close.
inputElement.focus();
// Remove the last selected item from the suggestions list.
updateSuggestions(options, state, inputElement.val(), originalSelect);
}
};
/**