radix-vue icon indicating copy to clipboard operation
radix-vue copied to clipboard

feat(DateField): improve month segment behavior for invalid months starting with 1

Open acabreragnz opened this issue 9 months ago • 1 comments

Changes

  • Modified the month segment behavior in DateField to handle invalid months starting with 1 (13-19) more intuitively
  • When typing invalid months like 13-19:
  • Keeps 1 as the month value
  • Automatically uses the second digit as the initial value for the day segment
  • Moves focus to day segment

Example

When typing "13":

  • "1" remains as the month value
  • Focus moves to day segment
  • "3" becomes the initial value of the day

Why

This change improves user experience by making the input behavior more intuitive when users type invalid month numbers. Instead of discarding the first digit, it uses both digits meaningfully - preserving the valid part (1) for the month and using the second digit to pre-fill the day.

Testing

  • [ ] Type "13" - should keep "1" as month and move to day with "3"
  • [ ] Type "14" - should keep "1" as month and move to day with "4"
  • [ ] Type "10", "11", "12" - should work as before (valid months)
  • [ ] Type "2"-"9" - should work as before (single digit months)

acabreragnz avatar Jan 16 '25 19:01 acabreragnz