Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

fix(Calendar): prevent auto-refocus on single selection mode (#8302)#8323

Merged
melloware merged 1 commit into
primefaces:masterfrom
Coderxrohan:fix-calendar-autofocus
Oct 7, 2025
Merged

fix(Calendar): prevent auto-refocus on single selection mode (#8302)#8323
melloware merged 1 commit into
primefaces:masterfrom
Coderxrohan:fix-calendar-autofocus

Conversation

@Coderxrohan

@Coderxrohan Coderxrohan commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Fixes #8302

Cause: In single selection mode, when a date is selected, the overlay closes but the input field is immediately refocused with reFocusInputField(). This prevents reopening the calendar by clicking the input again.

Implementation: Updated onDateSelect to conditionally skip the refocus when selectionMode === 'single'.

- reFocusInputField();
+ if (props.selectionMode !== 'single') {
+     reFocusInputField();
+ }

Result:

✅ Single selection mode → panel closes without auto-refocus, allowing the user to reopen the calendar by clicking the input.

✅ Range / multiple selection modes → auto-refocus remains, preserving accessibility.

@Coderxrohan

@melloware

Copy link
Copy Markdown
Member

you might have to run npm run format

@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label Oct 7, 2025
@Coderxrohan Coderxrohan force-pushed the fix-calendar-autofocus branch from 4fb7fcd to 355ac0a Compare October 7, 2025 11:54
@Coderxrohan

Copy link
Copy Markdown
Contributor Author

Can you confirm once @melloware
Passed all checks and working well.

@melloware melloware merged commit 849284f into primefaces:master Oct 7, 2025
2 checks passed
@Coderxrohan Coderxrohan deleted the fix-calendar-autofocus branch February 4, 2026 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Type: Bug Issue contains a defect related to a specific component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: reFocusInputField on single selection

2 participants