Skip to content

feat(hooks): add useLongPress hook#239

Merged
seungrodotlee merged 6 commits into
toss:mainfrom
jiji-hoon96:feat/useLongPress-hook
Jun 1, 2025
Merged

feat(hooks): add useLongPress hook#239
seungrodotlee merged 6 commits into
toss:mainfrom
jiji-hoon96:feat/useLongPress-hook

Conversation

@jiji-hoon96
Copy link
Copy Markdown
Contributor

Overview

This PR implements the useLongPress hook. This hook detects when an element is pressed and held for a specified duration. It supports both mouse and touch events, ensuring consistent behavior across desktop and mobile devices.
Key features

  • Configurable delay time (default: 500ms)
  • Movement threshold settings to cancel on drag
  • Separate callbacks for clicks and long press end events
  • Cross-platform support (mouse and touch events)

Documentation in both English and Korean is included.

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiji-hoon96

Thank you for your hard work in writing the documentation. Just a quick tip — in react-simplikit, documentation is automatically generated from JSDoc using deployment action's generate-docs after merged! You might find the link below helpful:

Copy link
Copy Markdown
Contributor Author

@jiji-hoon96 jiji-hoon96 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for forwarding the documentation guide!

I didn't look closely enough at the contribution guide as I was working on it.
I spent more time writing the docs than I realized...🥲

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d6cbe07) to head (f963a83).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #239   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        36    +1     
  Lines          988      1069   +81     
  Branches       301       319   +18     
=========================================
+ Hits           988      1069   +81     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@seungrodotlee seungrodotlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

@seungrodotlee seungrodotlee merged commit ae82195 into toss:main Jun 1, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants