Skip to content

Multiple "format" has been broken for us in new v4 versionΒ #911

@extempl

Description

@extempl

Use-case we have is more smart formatting with autocomplete, like if you enter 06 - it will assume that it is the 6th of current month of current year. But, and it is important, it were not trigger onChange (or, I assume it were, but didn't autocomplete the input until user explicitly trigger onChange by moving to other field, for example), so user could still add more to that, like 06.05, which would assume it is 5th month of current year.
To make it work we used format list like so

'DD.MM.YYYY', 'DD.M.YYYY', 'D.MM.YYYY', 'D.M.YYYY', 'DD.MM.YY', 'DD.M.YY', 'D.M.YY',
    'DD.MM', 'DD.M', 'D.M', 'DDMMYYYY', 'DDMMYY', 'DDMM', 'DD', 'D'

In the 3.4.7 -> v4 (like antd 5.13.3 -> 5.14.0) refactoring this approach does not work anymore, now it triggers onChange on any format match, like you enter 06 - it completes input with 06/02/2025, and user can't adjust it anymore.

As an additional feature request, I'd probably appreciate formatter/parser functionality with methods, like it is on InputNumber component to make it more stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions