Popover Outside Click Firing if bind:open is set to variable #336
-
Describe the bugThis one is really odd, if you set the bind:open to a variable like let open: boolean = false, the outsideClick stops working and considers any click inside of content to be an outside click as well. This is very problematic if your using this control for a menu and there are links in it because it cancels those link clicks as well. ReproductionSetup the popup, create some content add a link to that content. Then in you script tag setup a variable called open, and bind:open to it in root. Now when you click in the content, it fires OnOutsideClick event. You can verify the behavior by attaching to the OnOutsideClick event, and also by calling event.preventDefault() inside that will prevent the popup from closing and the links internally work. LogsNo response System Infon/a Severityannoyance |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Not able to reproduce this. |
Beta Was this translation helpful? Give feedback.
-
CleanShot.2024-02-14.at.11.53.41.mp4Please provide an actual reproduction repo or stackblitz as well as your system info |
Beta Was this translation helpful? Give feedback.
-
Ok, I'll throw together a quick repro as even stripped it down to bare bones in my project and it's still happening. So all that was left was the basic structure, no other components and it behaved like this, as a really hacky workaround I added the close button, made it hidden and then I click that button in code. It's a really dumb hack but it works. |
Beta Was this translation helpful? Give feedback.
-
You shouldn't have to hack it, what you're describing (if can be confirmed with a minimal reproduction) would in fact be a bug! I just need to see it happening to determine where the cause is and such. |
Beta Was this translation helpful? Give feedback.
-
You're binding a bunch of Popovers to a single open state. When you click outside one of the popovers into another of course the others are going to fire an |
Beta Was this translation helpful? Give feedback.
-
That was a very easy fix once you pointed it out. Thanks again! Works great now! |
Beta Was this translation helpful? Give feedback.
You're binding a bunch of Popovers to a single open state. When you click outside one of the popovers into another of course the others are going to fire an
outsideClick
. When youbind
that outside click in one popover is going to set it to false meaning it closes the others.