craft
craft copied to clipboard
Optimize autocomplete component
Change the dynamicContentObserver to this.
DOMHelper.onDynamicContent(
document.documentElement,
"select[data-s-autocomplete]",
(autocompletes) => {
Array.from(autocompletes).forEach((ac: HTMLSelectElement, index) => {
if (!ac.hasAttribute("data-s-autocomplete")) return;
new Autocomplete(ac, index);
});
},
"data-s-autocomplete"
);
Also update with the changes in https://bitbucket.org/statikbe/gsvfie/commits/7df1f7a001dc3f2f1f6c690788a355afb5c99c71