Click outside logic is broken for `static` Popover
See original GitHub issueIt looks like once you add static
to the <Popover.Panel>
the clicking outside logic no longer works properly. Instead, it will close the popover even when you click elements inside the panel, making it impossible to interact with.
Here’s a sandbox: https://codesandbox.io/s/headlessuireact-static-popover-bug-74uhq?file=/src/App.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Detect click outside React component - Stack Overflow
The following solution uses ES6 and follows best practices for binding as well as setting the ref through a method. To see it...
Read more >How to Dismiss a React-Bootstrap Popover on Click Outside
This guide explores how to dismiss a popover on clicking outside anywhere on the page. Popovers. Popovers can be used in several ways,...
Read more >Documentation: DevExtreme - JavaScript Lookup Configuration
Applies the selected value immediately after a user clicks the required value in the drop-down menu. To cancel the selection, click outside the...
Read more >UI Bootstrap - AngularUI
The outsideClick trigger will cause the popover to toggle on click, and hide when anything else is clicked. For any non-supported value, the...
Read more >Whats New - SurveyJS
... "off", "progressBarType": "buttons", "goNextPageAutomatic": true, "completeText": "Submit", "questionsOnPageMode": "singlePage", "widthMode": "static", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This also happens when not using the static prop. E.g. if I have a form inside the popover. (headlessui/vue)
Same problem here <Popover.Button as=“a”> and <Popover.Panel static tabIndex={-1}> both solves the issue.
However <Popover.Panel static tabIndex={-1}> marks the area of the panel > so i prefer the as=“a” solution.