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:
committed by
Dan Poltawski
parent
a60e8ba51e
commit
786e014c5c
+1
-1
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user