From dd77374b47122352d65a75e39abe6bdd1befe76c Mon Sep 17 00:00:00 2001 From: "Xavier Bol (xbo)" Date: Fri, 17 Mar 2023 15:50:44 +0000 Subject: [PATCH] [FIX] web: add missing input type in props Before this commit, when the user edits a float time field a border is displayed instead of having the same style then the others fields (float, integer, etc). The reason is a style is added (`outline: none;`) on input with `type="text"` but the type is missing on the input tag of float time field component. This commit adds a prop `inputType` and by default is `text` the others fields component and this prop is used to define the type on the input inside the template of float time component. Issue found in task-3000757 closes odoo/odoo#116629 X-original-commit: 8ec5f7eb73844daf278b3f2aafa73dd0d65ec59c Signed-off-by: Aaron Bohy (aab) Signed-off-by: Xavier Bol (xbo) --- .../static/src/views/fields/float_time/float_time_field.js | 7 ++++++- .../src/views/fields/float_time/float_time_field.xml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/views/fields/float_time/float_time_field.js b/addons/web/static/src/views/fields/float_time/float_time_field.js index 080728bb3ac..626e679b65e 100644 --- a/addons/web/static/src/views/fields/float_time/float_time_field.js +++ b/addons/web/static/src/views/fields/float_time/float_time_field.js @@ -14,8 +14,12 @@ export class FloatTimeField extends Component { static template = "web.FloatTimeField"; static props = { ...standardFieldProps, + inputType: { type: String, optional: true }, placeholder: { type: String, optional: true }, }; + static defaultProps = { + inputType: "text", + }; setup() { useInputField({ @@ -36,7 +40,8 @@ export const floatTimeField = { displayName: _lt("Time"), supportedTypes: ["float"], isEmpty: () => false, - extractProps: ({ attrs }) => ({ + extractProps: ({ attrs, options }) => ({ + inputType: options.type, placeholder: attrs.placeholder, }), }; diff --git a/addons/web/static/src/views/fields/float_time/float_time_field.xml b/addons/web/static/src/views/fields/float_time/float_time_field.xml index eee4e55bd5d..57e5e1637d0 100644 --- a/addons/web/static/src/views/fields/float_time/float_time_field.xml +++ b/addons/web/static/src/views/fields/float_time/float_time_field.xml @@ -3,7 +3,7 @@ - +