Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4861: Unexpected multiselect menu close when select #4864

Closed
wants to merge 1 commit into from

Conversation

xiaodong2008
Copy link
Contributor

This Pull Request fixed issue #4861: Multiselect - Menu closes on select

Change match rule:

isOutsideClicked(event) {
-    return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
+    return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)) || event.target.className.includes("p-multiselect-item"));
},

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 0:59am

@tugcekucukoglu
Copy link
Member

this.$el.contains(event.target) does the same thing and this PR does not solve the issue.

Thanks for your contribution!

@xiaodong2008
Copy link
Contributor Author

xiaodong2008 commented Nov 24, 2023

Hi, I’ve tested this PR and it solved the issue, please have a look again.

@xiaodong2008
Copy link
Contributor Author

xiaodong2008 commented Nov 24, 2023

The problem is because he sorts the options completely and vue removes some elements, so this.$el.contains can’t match it. Removed element can’t be searched by this method, needs to match the class.

@MaXal
Copy link

MaXal commented Apr 29, 2024

I still can reproduce the issue with the attached patch so it looks like it indeed doesn't solve the issue. But the method is definitely to blame since if change it to always return false the MultiSelect won't be closed.

@MaXal
Copy link

MaXal commented Apr 29, 2024

I provided a new PR with a fix that works in my case, @xiaodong2008 does it work for you as well: #5656 ?

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.

None yet

3 participants