Skip to content

Conversation

@navedqb
Copy link
Contributor

@navedqb navedqb commented Oct 29, 2025

Fixes #8352

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 14, 2025
@melloware melloware requested a review from mertsincan November 14, 2025 17:29
@melloware
Copy link
Member

@Coderxrohan can you review this one and check if your other fixes already fixed this issue?

@Coderxrohan
Copy link
Contributor

@melloware

I tested this behavior, https://stackblitz.com/edit/vitejs-vite-8xz26kct?file=src%2FApp.tsx

What I observed:

  • Selecting a date works as expected.
  • After the calendar closes, clicking the input again does not reopen the date picker immediately.
  • The date can still be edited via keyboard.
  • If focus is moved elsewhere and then the input is clicked again, the calendar opens.

From my testing, this behavior is not related to my recent changes and is not fixed by them.
It also feels more like focus/UX behavior than a clear functional bug, especially since keyboard input remains available (useful for large or far-range dates).

Sharing the StackBlitz repro here so we can confirm whether this is expected behavior or something that should be adjusted.

@Coderxrohan
Copy link
Contributor

Just to clarify the distinction between the previous fix and this issue:

The fix I worked on earlier (#8302 / #8323) addressed an auto-refocus problem in single selection mode.
After selecting a date, the input was being programmatically refocused via reFocusInputField(), which prevented reopening the calendar with a normal click.
That was fixed by skipping the refocus logic only for selectionMode="single", while keeping it for range/multiple modes.

The behavior discussed here is different.
From testing, this is about the calendar not reopening on input click after the panel closes, unless focus is reset.
This is related to click/focus handling and overlay open logic, not forced refocus after selection.

So:
**- The earlier fix removed unwanted auto-focus after selection.

  • This issue concerns whether clicking the input should explicitly reopen the overlay.**

There is no functional overlap between the two, and my previous changes neither caused nor fixed this behavior.
Sharing this clarification so the two concerns don’t get conflated.

@melloware
Copy link
Member

@Coderxrohan i agree.

@Coderxrohan
Copy link
Contributor

8359.mp4

Testting Locally on Localhost

@melloware melloware merged commit 6db5fa0 into primefaces:master Jan 2, 2026
3 checks passed
@Coderxrohan
Copy link
Contributor

Coderxrohan commented Jan 2, 2026

@melloware
Help Needed !

  1. When testing on localhost, it works normally, as shown in the attached video above,
    Behaviour = Normal

  2. When tested in https://stackblitz.com/edit/vitejs-vite-8xz26kct?file=package.json
    Behavior: The Calendar doesn't open after selection

  3. When tested in https://codesandbox.io/p/github/qburst/primereact-1/fix--8352 ( with this PR repo)
    Behave normally.

  4. When tested in https://primereact.org/calendar/
    Behavior: The Calendar doesn't open after selection

@melloware
Copy link
Member

It might be a react strict mode thing with double hook calls?

@Coderxrohan
Copy link
Contributor

It might be a react strict mode thing with double hook calls?

Yes, I think that’s very likely 👍

The inconsistent behavior only appears in environments running React Strict Mode (StackBlitz / primereact.org), while localhost and the CodeSandbox PR branch behave normally.

This points to double-invoked effects or focus/overlay timing differences under Strict Mode rather than an issue introduced by this PR.

From my side, nothing further to add — the fix looks good and the remaining behavior can be evaluated separately if we decide to handle Strict Mode explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Pending Review Issue or pull request is being reviewed by Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: show date-section on click

3 participants