Skip to content

fix(datatable): fix filter overlay closing when interacting with nested overlay components#8566

Open
VaishnaviD5900 wants to merge 1 commit into
primefaces:masterfrom
VaishnaviD5900:fix/datatable-multiselect-filter-overlay
Open

fix(datatable): fix filter overlay closing when interacting with nested overlay components#8566
VaishnaviD5900 wants to merge 1 commit into
primefaces:masterfrom
VaishnaviD5900:fix/datatable-multiselect-filter-overlay

Conversation

@VaishnaviD5900
Copy link
Copy Markdown

Description

When using components like MultiSelect, Select, or TreeSelect as custom
filters inside a DataTable column, the filter overlay panel closed
immediately upon interacting with any option.

Root Cause

The isOutsideClicked method in ColumnFilter only checked if the
clicked target was inside this.overlay. However, nested overlay panels
(like MultiSelect dropdown) are appended to the body by default, so they
exist outside this.overlay in the DOM, causing them to be incorrectly
treated as outside clicks.

Additionally, the overlayEventListener had a condition that prevented
selfClick from being set correctly for nested overlays.

Fix

  • Simplified overlayEventListener to always set selfClick = true
    when any overlay-click event is received
  • Updated isOutsideClicked to check if the target is inside any active
    overlay panel using closest('[data-pc-section="panel"], [data-pc-section="overlay"]')

How to Test

  1. Go to /datatable/#advanced_filter
  2. Click the filter icon on the "Agent" column
  3. Click any option in the MultiSelect, checkbox should toggle and
    panel should stay open
  4. Also verify clicking outside still correctly closes the panel

Closes

Closes #8537
Closes #8213

SpringSistemas5

This comment was marked as low quality.

oliversluke added a commit to oliversluke/tvheadend that referenced this pull request May 18, 2026
…tream PR

Adds a row tracking PrimeVue issues #8537 (MultiSelect) and
#8213 (TreeSelect) — DataTable filter popover dismissing on
clicks inside a body-portaled overlay widget. The bug shares
its root-cause family with the popover-dismiss issue we
already fixed downstream in `SettingsPopover.vue` (commit
`1ccd62cff`), so the row documents both surfaces.

A community contributor (`VaishnaviD5900`) submitted PR
[primevue#8566](primefaces/primevue#8566)
addressing both issues — uses PrimeVue's existing
`data-pc-section` attribute via `closest()` rather than a
class-name whitelist, which is cleaner than what our
downstream workaround does. The row notes a small follow-up
cleanup we can do once that PR merges: swap the hardcoded
PrimeVue overlay class selectors in our SettingsPopover for
the same `data-pc-section` lookup, dropping the
class-name-tracking burden.

Also captures a separate-path idea for a helper composable
(`useOverlayAwareClickOutside()`) to expose this pattern for
downstream consumers — explicitly deferred until #8566 merges
so the in-flight bug-fix isn't conflated with an API-design
ask.

Signed-off-by: Oliver Sluke <22557015+oliversluke@users.noreply.github.com>
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.

DataTable: MultiSelect filter overlay closes immediately when selecting an option <TreeSelect> As a filter component in <DataTable> select bug

2 participants