[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) <aab@odoo.com> Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -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-ref="numpadDecimal" t-att-placeholder="props.placeholder" inputmode="numeric" class="o_input" />
|
||||
<input t-else="" t-att-id="props.id" t-att-type="props.inputType" t-ref="numpadDecimal" t-att-placeholder="props.placeholder" inputmode="numeric" class="o_input" />
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
||||
Reference in New Issue
Block a user