Skip to content

fix: prevent MultiSelect overlay from closing on drag-end events orig…#8523

Open
mustafajw07 wants to merge 1 commit intoprimefaces:masterfrom
mustafajw07:bugfix/8517-multiselect
Open

fix: prevent MultiSelect overlay from closing on drag-end events orig…#8523
mustafajw07 wants to merge 1 commit intoprimefaces:masterfrom
mustafajw07:bugfix/8517-multiselect

Conversation

@mustafajw07
Copy link
Copy Markdown

@mustafajw07 mustafajw07 commented Apr 11, 2026

Defect Fixes

Fixes #8517

Describe the bug:
When using MultiSelect with filtering enabled, if a user clicks and drags to select text inside the filter input, and then releases the mouse outside the panel boundary, the overlay unexpectedly closes. This makes normal text-selection behavior feel broken because the panel is dismissed even though the interaction started inside the multiselect component.

Expected behavior:
The overlay should remain open. Releasing the mouse outside after starting a text-selection or drag interaction inside the MultiSelect component should not be treated as an outside dismiss action.

Solution:
Implemented a mousedownInsideOverlay ref to track where the mousedown event originated. Added a document mousedown listener (active only while the overlay is visible) to set this flag if the target is within the MultiSelect trigger or overlay. In the useOverlayListener's outside-click handler, we now ignore the dismiss action if the preceding mousedown originated inside the component, preventing unintended closures during drag-and-drop or text-selection gestures.

@github-actions
Copy link
Copy Markdown

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

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.

MultiSelect: Filter text selection

1 participant