From 655e1ea63cf469937c53762e93f93da40b6b9099 Mon Sep 17 00:00:00 2001 From: "Habib (ayh)" Date: Thu, 27 Apr 2023 12:43:46 +0000 Subject: [PATCH] [IMP] web: stop autocomplete click event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The analytic_distribution component used an extension of the AutoComplete component for 2 reasons. 1. to get access to the focus event 2. to stop propogation of the autocomplete input click (which prevented the analytic popup from functioning well) The need for the focus event was removed, and it doesn't make sense to maintain an extension to simply stop event propogation. For this reason, the extension was removed, and the `.stop` is added directly to the AutoComplete Part of task-3180055 closes odoo/odoo#122424 X-original-commit: ebee32b8aa994bfd3fd375f6deb10676356a5d4a Signed-off-by: William André (wan) Signed-off-by: Ayob Habib (ayh) --- addons/web/static/src/core/autocomplete/autocomplete.xml | 2 +- addons/web/static/tests/views/list_view_tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/core/autocomplete/autocomplete.xml b/addons/web/static/src/core/autocomplete/autocomplete.xml index 8ade9a819ed..d7534ce876f 100644 --- a/addons/web/static/src/core/autocomplete/autocomplete.xml +++ b/addons/web/static/src/core/autocomplete/autocomplete.xml @@ -11,7 +11,7 @@ t-att-placeholder="props.placeholder" t-model="state.value" t-on-blur="onInputBlur" - t-on-click="onInputClick" + t-on-click.stop="onInputClick" t-on-change="onInputChange" t-on-input="debouncedOnInput" t-on-keydown="onInputKeydown" diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index 36e0c9818b9..1c6bbf611b0 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -12283,7 +12283,7 @@ QUnit.module("Views", (hooks) => { "o_readonly_modifier" ); - await click(target.querySelector(".o_selected_row .o_field_many2one input")); + await click(target.querySelector(".o_selected_row .o_field_many2one")); assert.strictEqual( document.activeElement, target.querySelector(".o_selected_row .o_field_many2one input")