Closed kirbyfu closed 10 months ago
It appears this suggestion was incorporated at some point.
https://github.com/alexkatz/react-tiny-popover/blob/master/src/Popover.tsx#L183
Use clickOutsideCapture
to control "the useCapture option passed along as the third argument to the internal window.addEventListener used by onClickOutside."
@carlostpg You are correct. This prop is included in the docs as well. My apologies for leaving this issue open. I'll close this issue for now!
I'm currently hiding a popover when the user clicks outside by using
onClickOutside
. This generally works but when clicking other react-native buttons,onClickOutside
isn't triggered (react native buttons stops propagation to prevent click bubbling).Would changing this line to listen to the capture phase be reasonable?
Or perhaps adding
onClickOutsideCapture
if backwards compatibility is an issue.Sandbox example showing issue: https://codesandbox.io/s/musing-tharp-tjo25?file=/src/App.js