adobe / adobe/react-spectrum

DatePicker required validation is inconsistent when clearing different segments (month vs day/year)

Open
#9,958 10 comments 0 reactions 0 assignees View on GitHub
bug DateField RAC
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

The DatePicker component appears to validate inconsistently when a required field has individual date segments cleared.

### 🤔 Expected Behavior?

If the field is required, then clearing any required segment (`year`, `day`, or `month`) and blurring the input should produce a validation error consistently.

### 😯 Current Behavior

The DatePicker appears to validate inconsistently when a user clears different date segments after first selecting a valid date.

### 💁 Possible Solution

_No response_

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

Using the documentation example:

1. Open https://react-aria.adobe.com/DatePicker
2. Locate the example labelled “Appointment date”
3. Select a valid date from the calendar
4. Clear the year segment
5. Blur the input
6. A validation error is shown
7. Restore a valid date
8. Clear the day segment
9. Blur the input
10. A validation error is shown
11. Restore a valid date
12. Clear the month segment
13. Blur the input
14. No validation error is shown

### Version

1.16.0

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

MacOS Tahoe 26.4.1

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.