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 = $element->getAttributes();
|
||||||
$attrs->add('class', 'director-suggest');
|
$attrs->add('class', 'director-suggest');
|
||||||
$attrs->set([
|
$attrs->set([
|
||||||
'autocomplete' => 'off',
|
|
||||||
'autocorrect' => 'off',
|
|
||||||
'autocapitalize' => 'off',
|
|
||||||
'spellcheck' => 'false',
|
|
||||||
'data-suggestion-context' => $this->suggestionContext,
|
'data-suggestion-context' => $this->suggestionContext,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -677,6 +677,9 @@
|
||||||
if (! this.containerIsAutorefreshed($container) && ! this.containerIsAutoSubmitted($container)) {
|
if (! this.containerIsAutorefreshed($container) && ! this.containerIsAutoSubmitted($container)) {
|
||||||
this.putFocusOnFirstFormElement($container);
|
this.putFocusOnFirstFormElement($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Turn off autocomplete for all suggested fields
|
||||||
|
$container.find('input.director-suggest').each(this.disableAutocomplete);
|
||||||
},
|
},
|
||||||
|
|
||||||
highlightActiveDashlet: function($container)
|
highlightActiveDashlet: function($container)
|
||||||
|
@ -789,6 +792,14 @@
|
||||||
} else {
|
} else {
|
||||||
$fieldset.find('legend span.element-count').remove();
|
$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