Skip to content

MoneyType does not set steps like NumberType does #62620

@alcohol

Description

@alcohol

Symfony version(s) affected

6.4.* and up

Description

Unsure if this is on purpose or not (and if it is, what the rationale is); but when html5 is set to true, MoneyType only sets the input type to number but it does not check if steps should be set, which ultimately means that one can only enter whole values in the input field, even if a scale larger than 0 is set.

If the current value is 1.12 for example, the field will only accept 0.12 or 2.12 as the next lower/higher value.

How to reproduce

Set html5 to true.

Possible Solution

Implement the same approach that NumberType has: https://github.com/symfony/form/blob/a8f32aa19b322bf46cbaaafa89c132eb662ecfe5/Extension/Core/Type/NumberType.php#L40-L51

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions