Skip to content

fix: keep datepicker overlay open when clicking nested overlay - #710

Merged
NJevric merged 2 commits into
openvi-foundation:masterfrom
tokainz:fix/571-datepicker-nested-overlay-click
Nov 16, 2026
Merged

NJevric merged 2 commits into
openvi-foundation:masterfrom
tokainz:fix/571-datepicker-nested-overlay-click

Conversation

@tokainz

@tokainz tokainz commented Nov 15, 2026

Copy link
Copy Markdown

What does this PR do?

When a Select, or another overlay component, is placed in the header or footer slot of DatePicker, picking an option closed the calendar overlay.

The Select overlay is appended to body, so it sits outside the DatePicker overlay, and the DatePicker's outside-click listener treated the mousedown on an option as an outside click.

DatePicker now listens to overlay-click on the OverlayEventBus while the overlay is open. When the emitting component lives inside the DatePicker overlay, selfClick is set and the outside-click listener ignores that click. This follows the existing pattern used by Popover and the DataTable ColumnFilter.

Related issue

Closes #571

Checklist

  • Tests added or updated for the change
  • pnpm run lint and pnpm run format pass
  • Changelog entry added under ## [Unreleased] in CHANGELOG.md (skip for internal refactors, tests, CI, and docs typos)

@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

@tokainz is attempting to deploy a commit to the njevric's projects Team on Vercel.

A member of the Team first needs to authorize it.

@NJevric
NJevric self-requested a review November 15, 2026 19:34
@tokainz
tokainz force-pushed the fix/571-datepicker-nested-overlay-click branch from 41932c9 to a31af90 Compare November 16, 2026 10:30
@NJevric

NJevric commented Nov 16, 2026

Copy link
Copy Markdown
Member

Hi Tobias, thanks for taking the time to work on this!

This fixes the issue.
One thing that would make it complete would be when the Select dropdown is open and you click outside of it, only the Select should close and the calendar should stay open. Right now both close on that click.
I'll merge once that's in 👍

If you have time, I'd also love to see the same fix for the other components with overlays, like MultiSelect, AutoComplete, CascadeSelect and TreeSelect. Since this issue is only about Select, those could go in separate issues/PRs.

Thanks again for taking the time!

@tokainz

tokainz commented Nov 16, 2026

Copy link
Copy Markdown
Author

This fixes the issue. One thing that would make it complete would be when the Select dropdown is open and you click outside of it, only the Select should close and the calendar should stay open. Right now both close on that click. I'll merge once that's in 👍

Done

If you have time, I'd also love to see the same fix for the other components with overlays, like MultiSelect, AutoComplete, CascadeSelect and TreeSelect. Since this issue is only about Select, those could go in separate issues/PRs.

Sure I will add the other PRs in the next few days. Thanks for looking at it!

@NJevric

NJevric commented Nov 16, 2026

Copy link
Copy Markdown
Member

This fixes the issue. One thing that would make it complete would be when the Select dropdown is open and you click outside of it, only the Select should close and the calendar should stay open. Right now both close on that click. I'll merge once that's in 👍

Done

If you have time, I'd also love to see the same fix for the other components with overlays, like MultiSelect, AutoComplete, CascadeSelect and TreeSelect. Since this issue is only about Select, those could go in separate issues/PRs.

Sure I will add the other PRs in the next few days. Thanks for looking at it!

That was quick, thanks

@NJevric
NJevric merged commit 0faaab4 into openvi-foundation:master Nov 16, 2026
8 of 10 checks passed
github-actions Bot added a commit that referenced this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: Dropdown in #header or #footer slot not selectable.

2 participants