fix autocomplete not hiding issue
This commit is contained in:
@@ -219,6 +219,13 @@ function (Dep, From, EmailAddress) {
|
||||
autoSelectFirst: true,
|
||||
noCache: true,
|
||||
triggerSelectOnValidInput: false,
|
||||
beforeRender: () => {
|
||||
// Prevent an issue that suggestions are shown and not hidden
|
||||
// when clicking outside the window and then focusing back on the document.
|
||||
if (this.$input.get(0) !== document.activeElement) {
|
||||
setTimeout(() => this.$input.autocomplete('hide'), 30);
|
||||
}
|
||||
},
|
||||
formatResult: (suggestion) => {
|
||||
return this.getHelper().escapeString(suggestion.name) + ' <' +
|
||||
this.getHelper().escapeString(suggestion.id) + '>';
|
||||
|
||||
@@ -529,6 +529,12 @@ class LinkMultipleFieldView extends BaseFieldView {
|
||||
if (this.$element.hasClass('input-sm')) {
|
||||
$c.addClass('small');
|
||||
}
|
||||
|
||||
// Prevent an issue that suggestions are shown and not hidden
|
||||
// when clicking outside the window and then focusing back on the document.
|
||||
if (this.$element.get(0) !== document.activeElement) {
|
||||
setTimeout(() => this.$element.autocomplete('hide'), 30);
|
||||
}
|
||||
},
|
||||
formatResult: suggestion => {
|
||||
// noinspection JSUnresolvedReference
|
||||
|
||||
@@ -608,6 +608,12 @@ class LinkFieldView extends BaseFieldView {
|
||||
if (this.$elementName.hasClass('input-sm')) {
|
||||
$c.addClass('small');
|
||||
}
|
||||
|
||||
// Prevent an issue that suggestions are shown and not hidden
|
||||
// when clicking outside the window and then focusing back on the document.
|
||||
if (this.$elementName.get(0) !== document.activeElement) {
|
||||
setTimeout(() => this.$elementName.autocomplete('hide'), 30);
|
||||
}
|
||||
},
|
||||
lookup: (q, callback) => {
|
||||
if (!this.autocompleteOnEmpty && q.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user