Turn off autocomplete in JS for suggested elements
Instead of the PHP code, for all input.director-suggest elements
This commit is contained in:
parent
5dacabd437
commit
f63ee93f71
|
@ -207,10 +207,6 @@ class ExtensibleSetElement extends BaseHtmlElement
|
|||
$attrs = $element->getAttributes();
|
||||
$attrs->add('class', 'director-suggest');
|
||||
$attrs->set([
|
||||
'autocomplete' => 'off',
|
||||
'autocorrect' => 'off',
|
||||
'autocapitalize' => 'off',
|
||||
'spellcheck' => 'false',
|
||||
'data-suggestion-context' => $this->suggestionContext,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -677,6 +677,9 @@
|
|||
if (! this.containerIsAutorefreshed($container) && ! this.containerIsAutoSubmitted($container)) {
|
||||
this.putFocusOnFirstFormElement($container);
|
||||
}
|
||||
|
||||
// Turn off autocomplete for all suggested fields
|
||||
$container.find('input.director-suggest').each(this.disableAutocomplete);
|
||||
},
|
||||
|
||||
highlightActiveDashlet: function($container)
|
||||
|
@ -789,6 +792,14 @@
|
|||
} else {
|
||||
$fieldset.find('legend span.element-count').remove();
|
||||
}
|
||||
},
|
||||
|
||||
disableAutocomplete: function() {
|
||||
$(this)
|
||||
.attr('autocomplete', 'off')
|
||||
.attr('autocorrect', 'off')
|
||||
.attr('autocapitalize', 'off')
|
||||
.attr('spellcheck', 'false');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue