slash
slash copied to clipboard
fix(@toss/react): useOutsideClickEffect is called twice on touch event
Overview
Fixes https://github.com/toss/slash/issues/354 and https://github.com/toss/slash/issues/449
I agree with this answer. click
event works fine on touchable screen too, so there is no need to have a touch
event listener.
I believe another solution might be adding e.preventDefault()
for the touch
event. According to MDN:
... event.preventDefault() to keep the browser from continuing to process the touch event (this also prevents a mouse event from also being delivered).
However, I think this is a bit more over-engineering... so I decided to go with the first solution.
PR Checklist
- [✅] I read and included theses actions below
- I have read the Contributing Guide
- I have written documents and tests, if needed.
Deploy request for slash-libraries pending review.
Visit the deploys page to approve it
Name | Link |
---|---|
Latest commit | fee8286552ea01e77043e592d6cd028538409e03 |