nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
22k stars 1.54k forks source link

[BUG] - DateInput component prevents typing incomplete dates (e.g., inputting 31 becomes 01 automatically if month is not filled) #4060

Closed MartaBento closed 2 hours ago

MartaBento commented 3 hours ago

NextUI Version

2.4.8

Describe the bug

When using the DateInput component, inputting certain dates, such as “31” for the day, is impossible, unless the month field is filled out already.

This restriction creates a frustrating user experience, particularly for fields like “Date of Birth,” where users might want to input the day before the month or year.

Steps to Reproduce the Bug or Issue

  1. Add a DateInput component to a form;
  2. Focus on the date input field and attempt to type 31 as the day before filling in the month or year;
  3. Observe that the input automatically fills out 01, instead of 31.

Expected behavior

Users should be able to type day, month, and year in any order, including incomplete values (e.g., entering the day without specifying the month or year yet). The component should:

Screenshots or Videos

https://github.com/user-attachments/assets/84cdbd19-32be-45c3-a00e-a58d91cd0a0a

Operating System Version

macOS

Browser

Chrome

linear[bot] commented 3 hours ago

ENG-1558 [BUG] - DateInput Component Prevents Typing Incomplete Dates (e.g., Day Before Month/Year)

wingkwong commented 2 hours ago

see https://github.com/nextui-org/nextui/issues/2913#issuecomment-2085363909