signavio / react-stick

React component to stick a portaled node to an anchor node
https://react-stick.now.sh
MIT License
64 stars 6 forks source link

fix(SIGSPM-11659): use Element type for HandleClickOutside handler … #798

Closed AlaeddineMessadi closed 4 months ago

AlaeddineMessadi commented 4 months ago

https://jira.tools.sap/browse/SIGSPM-11659

In the editor, when a user click outside the global header on the canvas, it doesn't close the menu. the reason is canvas has SVGElement instead of HTMLElement. therefore I added to the handleClickOutside condition only SVGElement as I don't know what could be the side effect if we allow it all elements.

vercel[bot] commented 4 months ago

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

Name Status Preview Comments Updated (UTC)
react-stick ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 3:01pm
codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.35%. Comparing base (de83389) to head (c2478f1). Report is 571 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #798 +/- ## ========================================== - Coverage 96.09% 94.35% -1.75% ========================================== Files 13 13 Lines 282 354 +72 Branches 0 109 +109 ========================================== + Hits 271 334 +63 - Misses 11 19 +8 - Partials 0 1 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ThomasR commented 4 months ago

Issue Please add a testcase to tests/src/onClickOutside.test.tsx

AlaeddineMessadi commented 4 months ago

@ThomasR I believe the first Test in tests/src/onClickOutside.test.tsx is already covering the case?