Skip to content

DateRangePicker's controlled value can't be set to null to show the placeholder instead of the previous selected date #3187

@AlexLengyel

Description

@AlexLengyel

🐛 Bug Report

Value prop can't be set to null (as in the documentation) in DateRangePicker because TypeScript needs a DateValue type of value. Once the value prop has received a value then the value can't be removed completely from the date field to show just a placeholder again.

🤔 Expected Behavior

If the value prop in the DateRangePicker receives a null or undefined value then the previous selected date should be removed from the date field and should display a placeholder again instead of the previous selected date.

😯 Current Behavior

If the value prop in the DateRangePicker receives a null or undefined value then the previous selected date stays there in the date field.

🔦 Context

I am trying to reset the DateRangePicker's value to nothing to show the placeholder again after the previously selected date has been removed from the filtering list, so it makes less confusing for the users.

💻 Code Sample

🌍 Your Environment

Software Version(s)
react-spectrum 3.17.0
Browser Google Chrome
Operating System MacOS

🧢 Your Company/Team

AEM - Admin UI, Odin project

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions