slash icon indicating copy to clipboard operation
slash copied to clipboard

fix(@toss/react): useOutsideClickEffect is called twice on touch event

Open saul-atomrigs opened this issue 11 months ago • 1 comments

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
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

saul-atomrigs avatar Mar 24 '24 00:03 saul-atomrigs

Deploy request for slash-libraries pending review.

Visit the deploys page to approve it

Name Link
Latest commit fee8286552ea01e77043e592d6cd028538409e03

netlify[bot] avatar Mar 24 '24 00:03 netlify[bot]