Files
web/web_widget_numeric_step/static/src/xml/numeric_step.xml
Jairo Llopis 7722b38721 [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
2024-12-23 12:11:10 +01:00

48 lines
1.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2019 GRAP - Quentin DUPONT
Copyright 2020 Tecnativa - Alexandre Díaz
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<template>
<t t-name="web_widget_numeric_step" owl="1">
<div
class="d-flex widget_numeric_step"
t-on-mouseleave="_onFocusOutInput"
t-on-mouseenter="_onFocusInput"
>
<div class="input-group-prepend d-lg-none widget_numeric_step_btn">
<button
class="fa fa-minus btn btn-default btn_numeric_step"
aria-label="Minus"
title="Minus"
type="button"
data-mode="minus"
t-on-click="_onStepClick"
/>
</div>
<input
t-att-id="props.id"
t-ref="numpadDecimal"
t-att-placeholder="props.placeholder"
t-att-type="props.inputType"
class="o_input input_numeric_step"
inputmode="decimal"
t-att-step="props.step"
t-on-keydown="_onKeyDown"
t-on-wheel="_onWheel"
/>
<div class="input-group-append d-lg-none widget_numeric_step_btn">
<button
class="fa fa-plus btn btn-default btn_numeric_step"
aria-label="Plus"
title="Plus"
type="button"
data-mode="plus"
t-on-click="_onStepClick"
/>
</div>
</div>
</t>
</template>