mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-51970 autocomplete: Fix for a regression in MDL-51964
This was causing the suggestions list to never open. Picked up in testing for MDL-51970.
This commit is contained in:
parent
9fe1cb0421
commit
861c1dea98
2
lib/amd/build/form-autocomplete.min.js
vendored
2
lib/amd/build/form-autocomplete.min.js
vendored
File diff suppressed because one or more lines are too long
@ -651,16 +651,15 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
|
||||
inputElement.on('input', function(e) {
|
||||
var query = $(e.currentTarget).val();
|
||||
var last = $(e.currentTarget).data('last-value');
|
||||
if (typeof last === 'undefined') {
|
||||
last = query;
|
||||
}
|
||||
// IE11 fires many more input events than required - even when the value has not changed.
|
||||
// We need to only do this for real value changed events or the suggestions will be
|
||||
// unclickable on IE11 (because they will be rebuilt before the click event fires).
|
||||
if (last != query) {
|
||||
// Note - because of this we cannot close the list when the query is empty or it will break
|
||||
// on IE11.
|
||||
if (last !== query) {
|
||||
updateSuggestions(options, state, query, originalSelect);
|
||||
$(e.currentTarget).data('last-value', query);
|
||||
}
|
||||
$(e.currentTarget).data('last-value', query);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user