From d914b4eadc30920da3f2fba33906c25a079f8408 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 12 Dec 2023 09:50:16 +0000 Subject: [PATCH] [IMP] web_widget_numeric_step: display always on mobile Mobile screens benefit most from this module's enhanced usability. However, since the events used for displaying/hiding the +/- buttons depend on mouse, at the end you'll never see these buttons on mobile screens. Thus, here's a new approach: smaller screens *always* display the buttons. Besides, inputmode is now decimal, just like upstream float fields. @moduon MT-4396 --- web_widget_numeric_step/static/src/js/numeric_step.esm.js | 4 ++-- web_widget_numeric_step/static/src/xml/numeric_step.xml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web_widget_numeric_step/static/src/js/numeric_step.esm.js b/web_widget_numeric_step/static/src/js/numeric_step.esm.js index dcd6f233e..aebc06f27 100644 --- a/web_widget_numeric_step/static/src/js/numeric_step.esm.js +++ b/web_widget_numeric_step/static/src/js/numeric_step.esm.js @@ -11,11 +11,11 @@ export class NumericStep extends FloatField { } _onFocusInput(ev) { const $el = $(ev.target).parent().find(".widget_numeric_step_btn"); - $el.removeClass("d-none"); + $el.removeClass("d-lg-none"); } _onFocusOutInput(ev) { const $el = $(ev.target).find(".widget_numeric_step_btn"); - $el.addClass("d-none"); + $el.addClass("d-lg-none"); } _onStepClick(ev) { const $el = $(ev.target).parent().parent().find("input"); diff --git a/web_widget_numeric_step/static/src/xml/numeric_step.xml b/web_widget_numeric_step/static/src/xml/numeric_step.xml index e645a3923..de2c313fc 100644 --- a/web_widget_numeric_step/static/src/xml/numeric_step.xml +++ b/web_widget_numeric_step/static/src/xml/numeric_step.xml @@ -11,7 +11,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). t-on-mouseleave="_onFocusOutInput" t-on-mouseenter="_onFocusInput" > -
+