From bd1cd3ff1d3cd81b4860c0fd4f71800156f3d229 Mon Sep 17 00:00:00 2001 From: Dominik Piatek Date: Tue, 25 Jan 2022 10:36:29 +0000 Subject: [PATCH] Set autocomplete to off when component enabled --- preview/app/views/components/company_autocomplete_vw.html.erb | 2 +- src/core/CompanyAutocomplete/component.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/preview/app/views/components/company_autocomplete_vw.html.erb b/preview/app/views/components/company_autocomplete_vw.html.erb index d173394d4..915d60499 100644 --- a/preview/app/views/components/company_autocomplete_vw.html.erb +++ b/preview/app/views/components/company_autocomplete_vw.html.erb @@ -3,7 +3,7 @@ <% end %>
- +
<% content_for :component do %> diff --git a/src/core/CompanyAutocomplete/component.js b/src/core/CompanyAutocomplete/component.js index 9d505a101..b7235c0f0 100644 --- a/src/core/CompanyAutocomplete/component.js +++ b/src/core/CompanyAutocomplete/component.js @@ -162,6 +162,8 @@ const handleEnter = (input, event) => { const CompanyAutocomplete = (input, url) => { if (!input || !url) return; + input.setAttribute("autocomplete", "off"); + input.addEventListener( "keyup", throttle(