Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Picker set selectedDate to null doesn't clear date input #4344

Closed
4 of 11 tasks
origami-z opened this issue Oct 28, 2024 · 0 comments · Fixed by #4418
Closed
4 of 11 tasks

Date Picker set selectedDate to null doesn't clear date input #4344

origami-z opened this issue Oct 28, 2024 · 0 comments · Fixed by #4418
Labels
community For issues that have been raised by folks outside the core Salt team component: date input component: date picker

Comments

@origami-z
Copy link
Contributor

origami-z commented Oct 28, 2024

Latest version

  • I have tested the latest version

Description

Can't set selectedDate to null to clear date input

Steps to reproduce

Control selectedDate set to null

https://stackblitz.com/edit/salt-template-tfbgv5?file=App.tsx

Workaround: control date input value as well: https://stackblitz.com/edit/salt-template-mlhorv?file=App.tsx

Expected behavior

My guess if is wrong?

const formattedDate = format(date || null);
if (formattedDate) {
setDateValue(formattedDate);
onDateValueChange?.(formattedDate, true);

To be fixed before #4096

Package name(s)

Lab (@salt-ds/lab)

Package version(s)

lab 52

Browser

  • Chrome
  • Safari
  • Firefox
  • Microsoft Edge

Operating system

  • macOS
  • Windows
  • Linux
  • iOS
  • Android

Are you a JPMorgan Chase & Co. employee?

  • I am an employee of JPMorgan Chase & Co.
@origami-z origami-z added type: bug 🪲 status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. component: date input component: date picker labels Oct 28, 2024
@origami-z origami-z added the community For issues that have been raised by folks outside the core Salt team label Oct 28, 2024
@origami-z origami-z linked a pull request Nov 29, 2024 that will close this issue
@joshwooding joshwooding removed status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. type: bug 🪲 labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community For issues that have been raised by folks outside the core Salt team component: date input component: date picker
Projects
Development

Successfully merging a pull request may close this issue.

2 participants