Skip to content

Commit

Permalink
disable slider scroll detection if initialX/Y is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerwyn committed Dec 29, 2024
1 parent fe6ef90 commit baae55f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/universal-remote-card.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/classes/remote-slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ export class RemoteSlider extends BaseRemoteElement {
}

onMove(e: TouchEvent | MouseEvent) {
if (!this.vertical) {
if (
!this.vertical &&
this.initialX != undefined &&
this.initialY != undefined
) {
super.onMove(e);
console.log(
`X: ${Math.abs((this.currentX ?? 0) - (this.initialX ?? 0))}`,
Expand Down

0 comments on commit baae55f

Please sign in to comment.