diff --git a/app/webpacker/controllers/accessible_autocomplete_controller.js b/app/webpacker/controllers/accessible_autocomplete_controller.js index 5ca1b2c35..2ce617613 100644 --- a/app/webpacker/controllers/accessible_autocomplete_controller.js +++ b/app/webpacker/controllers/accessible_autocomplete_controller.js @@ -4,11 +4,9 @@ import 'accessible-autocomplete/dist/accessible-autocomplete.min.css' export default class extends Controller { connect() { - if(document.querySelectorAll(".autocomplete__input").length == 0){ - accessibleAutocomplete.enhanceSelectElement({ - defaultValue: '', - selectElement: this.element - }) - } + accessibleAutocomplete.enhanceSelectElement({ + defaultValue: '', + selectElement: this.element.querySelector('input') + }) } }