Merge branch 'MDL-63198-master' of git://github.com/rezaies/moodle
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -719,10 +719,13 @@ function($, log, str, templates, notification, LoadingIcon) {
|
||||
// Get the current element with focus.
|
||||
var focusElement = $(document.activeElement);
|
||||
|
||||
// Only close the menu if the input hasn't regained focus, and if the element still exists.
|
||||
// Only close the menu if the input hasn't regained focus and if the element still exists,
|
||||
// and regain focus if the scrollbar is clicked.
|
||||
// Due to the half a second delay, it is possible that the input element no longer exist
|
||||
// by the time this code is being executed.
|
||||
if (focusElement.attr('id') != inputElement.attr('id') && $('#' + state.inputId).length) {
|
||||
if (focusElement.is(document.getElementById(state.suggestionsId))) {
|
||||
inputElement.focus(); // Probably the scrollbar is clicked. Regain focus.
|
||||
} else if (!focusElement.is(inputElement) && $(document.getElementById(state.inputId)).length) {
|
||||
if (options.tags) {
|
||||
pendingPromise.then(function() {
|
||||
return createItem(options, state, originalSelect);
|
||||
|
||||
Reference in New Issue
Block a user