Browse Source

Don't progressively enhance select options multiple times

pull/183/head
baarkerlounger 3 years ago
parent
commit
d655b6872d
  1. 10
      app/webpacker/controllers/accessible_autocomplete_controller.js

10
app/webpacker/controllers/accessible_autocomplete_controller.js

@ -4,9 +4,11 @@ import 'accessible-autocomplete/dist/accessible-autocomplete.min.css'
export default class extends Controller { export default class extends Controller {
connect() { connect() {
accessibleAutocomplete.enhanceSelectElement({ if(document.querySelectorAll(".autocomplete__input").length == 0){
defaultValue: '', accessibleAutocomplete.enhanceSelectElement({
selectElement: this.element defaultValue: '',
}) selectElement: this.element
})
}
} }
} }

Loading…
Cancel
Save