Commit f58f71b
authored
fix(DateField): prevent day value from being incorrectly constrained during input (#2291)
When entering dates like "3/31/" and starting to type the year, the day
was
incorrectly changed from 31 to 30. This occurred because date fields
were
being set sequentially (day before month), causing the
@internationalized/date
library to constrain the day based on the placeholder's month instead of
the
user-entered month.
Changes:
- Set all date fields simultaneously in handleSegmentKeydown to avoid
order-dependent constraints
- Include month from segmentValues in daySegmentAttrs for correct
aria-valuemax calculation
Fixes issue where months with 31 days would be constrained to 30 or
fewer
days during initial input.1 parent 40d82dc commit f58f71b
File tree
1 file changed
+12
-7
lines changed1 file changed
+12
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
864 | 872 | | |
865 | 873 | | |
866 | 874 | | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
873 | 878 | | |
874 | 879 | | |
875 | 880 | | |
| |||
0 commit comments