From 319250f6979af0b0c380af59e6b26c2812225be7 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Wed, 22 Dec 2021 19:30:11 +0000 Subject: [PATCH] Set enhancement on input --- .../controllers/accessible_autocomplete_controller.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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') + }) } }