Skip to content

DateField leading 0 in Year leads to unexpected results #9952

@bmsuseluda

Description

@bmsuseluda

Provide a general summary of the issue here

When i mistakenly enter a 0 as the first number in the year field followed by another number, the 0 disappears visually. But the leading 0 seems to be there under the hood, because i can not type the actual year as an example. "02026" results in "6". Then you are kind of stuck in this behavior and need to blur out or remove the input entirely.

🤔 Expected Behavior?

If a leading 0 in the year field is allowed, then it should be visible or removed visually and internally.

😯 Current Behavior

When i mistakenly enter a 0 as the first number in the year field followed by another number, the 0 disappears visually. But the leading 0 seems to be there under the hood, because i can not type the actual year as an example. "02026" results in "6". Then you are kind of stuck in this behavior and need to blur out or remove the input entirely.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

This can be reproduced on the react aria DateField page: https://react-aria.adobe.com/DateField#format-options

Version

react-aria-components: 1.17.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

on Firefox and Safari as well

What operating system are you using?

OSX

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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