-
Notifications
You must be signed in to change notification settings - Fork 14
feat(dial-pad): add long press on '0' button to render '+' (VIV-2876) #2585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2585 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 416 416
Lines 20176 20211 +35
Branches 3386 3394 +8
=========================================
+ Hits 20176 20211 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
05778ab to
bdeaa96
Compare
| const target = event.currentTarget as HTMLElement | null; | ||
|
|
||
| this._longPressTimeoutId = window.setTimeout(() => { | ||
| this._suppressNextClick = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem if click is not fired, then the next button click will be ignored
| return event; | ||
| } | ||
|
|
||
| it('tapping 0 adds "0"', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow our naming convention with 'should'
| it('tapping 0 adds "0"', async () => { | |
| it('should add "0" when tapping 0', async () => { |
| @pointerdown="${(x, c) => | ||
| c.parent._startLongPress(x.value, c.event as PointerEvent)}" | ||
| @pointerup="${(_, c) => c.parent._endLongPress()}" | ||
| @pointercancel="${(_, c) => c.parent._cancelLongPress()}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think pointercancel will always fire pointerleave as well
| @pointercancel="${(_, c) => c.parent._cancelLongPress()}" |
| @pointerup="${(_, c) => c.parent._endLongPress()}" | ||
| @pointercancel="${(_, c) => c.parent._cancelLongPress()}" | ||
| @pointerleave="${(_, c) => c.parent._cancelLongPress()}" | ||
| @click="${onDigitClick}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about long-pressing with the keyboard? It should probably long-press with space as well
Maybe it would be easier to track the time when the pointer or keyboard press started and determine in the click handler if it was a long press. Just note that pointer/keyup is fired before click
No description provided.