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

Calendar component in DataTable PrimeReact 10.x: Date selection sets value to null, Clear button works as expected #7389

Closed
darioEscuderop opened this issue Nov 5, 2024 · 4 comments · Fixed by #7401
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@darioEscuderop
Copy link

Describe the bug

There is an issue with the Calendar component in PrimeReact version 10.x. When selecting a date by clicking on it, the value of the calendar remains null, and the date is not set in the input field. This behavior occurs despite the "Clear" button working as expected, correctly clearing the value and triggering focus lose.

In version 9.5.0, this issue does not occur, and both the "Clear" button and date selection work as expected. However, in version 10.x, selecting a date via click results in a null value.

In 9.5.0 after clicking the "Clear" button in the calendar, the focus remains on the input field, which allows the user to click "Clear" multiple times without closing the calendar or losing focus. But this is less important than what happend in 10.X version.

Reproducer

https://stackblitz.com/edit/vitejs-vite-5wzdws?file=src%2FApp.jsx

System Information

npmPackages:
    primereact: ^10.8.3 => 10.8.4 
    react: ^18.2.0 => 18.2.0

Steps to reproduce the behavior

  1. Open the calendar and click on a date to select it.
  2. Observe that after selecting the date, the value remains null in the input field.

Expected behavior

After selecting a date by clicking on it in the calendar, the input field should display the selected date, and the value should be updated accordingly.

@darioEscuderop darioEscuderop added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 5, 2024
@melloware
Copy link
Member

cc @KumJungMin can you look at this one?

@KumJungMin
Copy link
Contributor

KumJungMin commented Nov 6, 2024

cc @KumJungMin can you look at this one?


I’ll check it by November 8 :)

@KumJungMin
Copy link
Contributor

KumJungMin commented Nov 7, 2024

@darioEscuderop

is the implementation you are expecting similar to the example shown in the video below?
If the intended implementation matches the video, I will modify the BodyCell component and submit a PR for review. :)

2024-11-07.11.10.07.mov

@darioEscuderop
Copy link
Author

@KumJungMin

Yes, that’s exactly what I’m expecting. Additionally, as indicated in my code, I’d like it to always save a fixed time—specifically, 12:00 in this case. I’m not sure if that would be an issue as well. The video looks great!

Thank you!

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 7, 2024
@melloware melloware added this to the 10.8.5 milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants