[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
This commit is contained in:
Jairo Llopis
2023-12-12 09:50:16 +00:00
committed by Carlos Roca
parent cd46f8958a
commit a9c6da55df
5 changed files with 8 additions and 8 deletions

View File

@@ -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");