Skip to content
Snippets Groups Projects
Commit 8b919ae5 authored by Hubert Van de Walle (huvw)'s avatar Hubert Van de Walle (huvw)
Browse files

[FIX] web: allow to use the hour:minute on mobile for FloatTimeField


Steps to reproduce
==================

- Use an android phone
- Go to Timesheets
- Click on Add a line
- Click on the Hours Spent input

The keyboard is missing the colon `:` symbol

It is then only possible the enter a time in the float format.

Cause of the issue
==================

The inputmode=decimal attribute prevents a user from entering a `:`
symbol

Note that this doesn't happen on IOS, since the inputmode is ignored for
other reasons.

opw-3278089

closes odoo/odoo#120697

Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
parent a0bde41d
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
<t t-name="web.FloatTimeField" owl="1">
<span t-if="props.readonly" t-esc="formattedValue" />
<input t-else="" t-att-id="props.id" t-att-type="props.inputType" t-ref="numpadDecimal" t-att-placeholder="props.placeholder" inputmode="decimal" class="o_input" />
<input t-else="" t-att-id="props.id" t-att-type="props.inputType" t-ref="numpadDecimal" t-att-placeholder="props.placeholder" class="o_input" />
</t>
</templates>
......@@ -176,4 +176,19 @@ QUnit.module("Fields", (hooks) => {
"Placeholder"
);
});
QUnit.test("float_time field does not have an inputmode attribute", async function (assert) {
await makeView({
serverData,
type: "form",
resModel: "partner",
arch: `
<form>
<field name="qux" widget="float_time" placeholder="Placeholder"/>
</form>`,
});
const input = target.querySelector(".o_field_widget[name='qux'] input");
assert.notOk(input.attributes.inputMode);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment