Skip to content
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

task(HTL-113265): Pointer fix first commit #1542

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

coolestKev
Copy link
Collaborator

@coolestKev coolestKev commented Dec 20, 2024

Problem:
On mobile devices, touch scrolling can be misinterpreted as a drag action, potentially causing the Drawer container to respond incorrectly to the event.

See video for symptoms attached in previous PR, had to close due to a branch issue: #1541

Solution:

    /**
     * Differentiating between content scrolling and container dragging on mobile:
     *
     * 1. Content scrolling:
     *    - Triggered by touch events
     *    - Has a 'pointercancel' event type
     *
     * 2. Container dragging:
     *    - Should not occur accidentally during content scrolling
     *    - Has a 'pointerup' event type
     *
     * To prevent unintended container dragging, we only allow
     * dragging when the event type is specifically 'pointerup'.
     * This ensures smooth content scrolling without accidental
     * container movement.
     */

@coolestKev coolestKev marked this pull request as ready for review December 20, 2024 15:57
* container movement.
*/

if (pointerType === 'touch' && type === 'pointerup') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm confused, how can it be both, aren't they each specifying a different action touch/mouse ?

Copy link
Collaborator Author

@coolestKev coolestKev Dec 20, 2024

Choose a reason for hiding this comment

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

Note: Hopped on a call and addressed this question.

  • pointerType is what determines the mouse, touch interaction
  • type is the finer, more granular event type

@coolestKev coolestKev merged commit 4f0fa6a into main Dec 20, 2024
9 checks passed
@coolestKev coolestKev deleted the task/htl-113265-duplicate-two-pointer-fix branch December 20, 2024 16:29
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.

3 participants