Skip to content

Conversation

@Vrishabhsk
Copy link

Issue

Feature

  • Introduce min-swipe-threshold attribute for the tp-slider element
  • Default value is 0 since we don't want to affect the existing behaviour
  • Only if the range of the swipe distance falls between the swipeThreshold and minSwipeThreshold for left and right swipe, we register it.

@Vrishabhsk Vrishabhsk requested a review from Copilot October 24, 2025 10:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a minimum swipe threshold feature for the tp-slider component to prevent unintentional swipes on mobile devices. The new min-swipe-threshold attribute allows developers to define a minimum distance required before a swipe gesture is registered, improving UX when users interact with select or input elements within the slider.

Key Changes:

  • Added min-swipe-threshold attribute with a default value of 0 to maintain backward compatibility
  • Updated swipe detection logic to require swipe distance to fall within both minimum and maximum thresholds
  • Documented the new attribute in the slider README

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/slider/tp-slider.ts Implements the minimum swipe threshold property and updates swipe detection logic to enforce both minimum and maximum thresholds
src/slider/README.md Documents the new min-swipe-threshold attribute with its default value and purpose

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@junaidbhura
Copy link
Contributor

Thanks @Vrishabhsk please test this on a few internal projects before we merge it!

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.

2 participants