From 0889f10f589126ac29748cd993768283dc1237ea 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/README.rst | 2 +- web_widget_numeric_step/i18n/web_widget_numeric_step.pot | 2 +- web_widget_numeric_step/static/description/index.html | 2 +- web_widget_numeric_step/static/src/numeric_step.esm.js | 5 ----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/web_widget_numeric_step/README.rst b/web_widget_numeric_step/README.rst index 8541f11c0..b5ddc5dc2 100644 --- a/web_widget_numeric_step/README.rst +++ b/web_widget_numeric_step/README.rst @@ -7,7 +7,7 @@ Web Widget Numeric Step !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:aa00ea1d2e4245170c8f2a6e774bffe29af982ceddd43292a7871cf6f194fc25 + !! source digest: sha256:1062d0c26bb10198c524113d70fa069c5928514e9569f607316544fee88bb6d9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_widget_numeric_step/i18n/web_widget_numeric_step.pot b/web_widget_numeric_step/i18n/web_widget_numeric_step.pot index 5bdc9faaf..925a5eac5 100644 --- a/web_widget_numeric_step/i18n/web_widget_numeric_step.pot +++ b/web_widget_numeric_step/i18n/web_widget_numeric_step.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 17.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/web_widget_numeric_step/static/description/index.html b/web_widget_numeric_step/static/description/index.html index 11aa54e48..8b24125bf 100644 --- a/web_widget_numeric_step/static/description/index.html +++ b/web_widget_numeric_step/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:aa00ea1d2e4245170c8f2a6e774bffe29af982ceddd43292a7871cf6f194fc25 +!! source digest: sha256:1062d0c26bb10198c524113d70fa069c5928514e9569f607316544fee88bb6d9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This widget changes input number field and make it easier to increment 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); }