DatePicker calendar today render on first open #1633

Open
opened 2026-01-29 17:56:31 +00:00 by claunia · 4 comments
Owner

Originally created by @Anspitzen on GitHub (Feb 20, 2025).

Describe the bug
When opening the calendar for picking on a pre-set DatePicker the Today-date is rendered as if mouse is hovering over it. On selecting any date and opening the calendar again, the today is not rendered as hover but standard day (with frame for marking it as today)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Demo pages
  2. Preset the value with a day different from today and run it
  3. Open the calendar for selecting a different date
  4. See error

Expected behavior
The field for today should be rendered as default also on first opening

Screenshots
Image

Originally created by @Anspitzen on GitHub (Feb 20, 2025). **Describe the bug** When opening the calendar for picking on a pre-set DatePicker the Today-date is rendered as if mouse is hovering over it. On selecting any date and opening the calendar again, the today is not rendered as hover but standard day (with frame for marking it as today) **To Reproduce** Steps to reproduce the behavior: 1. Go to [Demo pages](https://blazor.radzen.com/datepicker?theme=standard) 2. Preset the value with a day different from today and run it 3. Open the calendar for selecting a different date 4. See error **Expected behavior** The field for today should be rendered as default also on first opening **Screenshots** ![Image](https://github.com/user-attachments/assets/ec95a32a-4567-4b0e-9ab4-ce9819fc9087)
Author
Owner

@enchev commented on GitHub (Feb 26, 2025):

Not sure I understand what you are reporting. Here is what I see:

https://github.com/user-attachments/assets/79b96fca-7a7e-486c-bacc-cfd4a012e925

@enchev commented on GitHub (Feb 26, 2025): Not sure I understand what you are reporting. Here is what I see: https://github.com/user-attachments/assets/79b96fca-7a7e-486c-bacc-cfd4a012e925
Author
Owner

@Anspitzen commented on GitHub (Feb 26, 2025):

Thats also what I also see. But if you now select (click) any date different and re-open the calendar the today is not rendered as a rz-state-focused css class. Then it is rendered as expected, only the tile below the pointer is rendered as "rz-state-focused". And not the today also. The "rz-calendar-today" is the blue frame and text, not the blue background from the rz-state-focused css class.
I don't know why the tile for today has the rz-state-focused also on first render hard baked into it.

Image

@Anspitzen commented on GitHub (Feb 26, 2025): Thats also what I also see. But if you now select (click) any date different and re-open the calendar the today is not rendered as a rz-state-focused css class. Then it is rendered as expected, only the tile below the pointer is rendered as "rz-state-focused". And not the today also. The "rz-calendar-today" is the blue frame and text, not the blue background from the rz-state-focused css class. I don't know why the tile for today has the rz-state-focused also on first render hard baked into it. ![Image](https://github.com/user-attachments/assets/6ff8679c-026d-4ee6-9345-2451002f298b)
Author
Owner

@Anspitzen commented on GitHub (Feb 26, 2025):

From Browser inspector, on first open the calendar dates are renderd with the classes: (edit: Sorry, mixed up the pictures)

Image

On second open (I selected the 28th again for comparability, so no real change in the bound data behind it) the classes are like this:

Image

The state active is superseeding the state focused, so you can't see it anymore after selecting any date. And the "normal" background for the focused is done with a css pseudo-class I think (some :hover somewhere). So I'm not sure, what the focused is even there for

@Anspitzen commented on GitHub (Feb 26, 2025): From Browser inspector, on first open the calendar dates are renderd with the classes: (edit: Sorry, mixed up the pictures) ![Image](https://github.com/user-attachments/assets/0a0c84bf-b380-45f3-b22f-27d59dfcb7fe) On second open (I selected the 28th again for comparability, so no real change in the bound data behind it) the classes are like this: ![Image](https://github.com/user-attachments/assets/cda91571-bff0-4fb5-a726-04f770ed649e) The state active is superseeding the state focused, so you can't see it anymore after selecting any date. And the "normal" background for the focused is done with a css pseudo-class I think (some :hover somewhere). So I'm not sure, what the focused is even there for
Author
Owner

@Cosmatevs commented on GitHub (Jun 9, 2025):

When navigating through the calendar using the keyboard, the focused state indicates which day will be selected when you press Enter.

Image

@Cosmatevs commented on GitHub (Jun 9, 2025): When navigating through the calendar using the keyboard, the focused state indicates which day will be selected when you press Enter. ![Image](https://github.com/user-attachments/assets/8b3de8db-27aa-4458-9111-a23a01b38585)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1633