Closed yairEO closed 2 years ago
Base: 96.00% // Head: 95.90% // Decreases project coverage by -0.10%
:warning:
Coverage data is based on head (
4ac0afb
) compared to base (06660f1
). Patch coverage: 80.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
I've changed my mind - no need for this
Added
options
optional argument (Object) touseClickOutside
:target
control over
mousedown
/mouseup
event handlers target (beside thedocument
).For example, in
React
the whole app resides with a wrapper element and not directly<body>
so thetarget
options could be set to something likedocument.querySelector('#root')
and so, if any "portaled" element (on thebody
) would not be considered as a "click outside".condition
Before this change, the only way to bypass the
isClickedOutside
condition (defined within the context) was to wrap the component with<ClickOutsideOverride>
and pass acondition
prop.If a functional component is using the
useClickOutside
hook, it is easier to pass an argument than to wrap the JSX with a context provider (ClickOutsideOverride
).