From 4d0c23b76beb8b031db9bd4de920f7cb7c51fec5 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Thu, 8 Aug 2024 08:02:39 +0200 Subject: [PATCH] [FIX] web_widget_numeric_step: Remove focus to avoid annoying flickering effect The focus introduced on the 16.0 migration is causing a flickering effect that is a bit annoying and does not make complete sense, because if you click more than once the cursor is positioned at the end of the text, which makes it difficult to edit the input. The counterpart of these changes is that to edit the input using the keyboard we will have to click on the field. Although this is how the module has been operating since its inception. --- web_widget_numeric_step/static/src/numeric_step.esm.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web_widget_numeric_step/static/src/numeric_step.esm.js b/web_widget_numeric_step/static/src/numeric_step.esm.js index 09994684c..f4c885c94 100644 --- a/web_widget_numeric_step/static/src/numeric_step.esm.js +++ b/web_widget_numeric_step/static/src/numeric_step.esm.js @@ -1,6 +1,5 @@ /** @odoo-module */ -import {hasTouch} from "@web/core/browser/feature_detection"; import {_lt} from "@web/core/l10n/translation"; import {registry} from "@web/core/registry"; import {FloatField} from "@web/views/fields/float/float_field"; @@ -11,10 +10,6 @@ export class NumericStep extends FloatField { super.setup(); } _onStepClick(ev) { - const $el = $(ev.target).parent().parent().find("input"); - if (!hasTouch()) { - $el.focus(); - } const mode = $(ev.target).data("mode"); this._doStep(mode); }