Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
fix range slider
Browse files Browse the repository at this point in the history
  • Loading branch information
7nik committed Sep 4, 2023
1 parent de18f53 commit 2b7d0a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# NeonMob Trade Enhancements changelog

## 3.3.3
* Fixed the range slider broken in 3.3.2

## 3.3.2
* Improve compatibility with touch devices

Expand Down
4 changes: 2 additions & 2 deletions app/components/elements/DoubleRange.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
function startDrag (ev: MouseEvent | TouchEvent, isLeft: boolean) {
ev.preventDefault();
const isTouch = ev instanceof TouchEvent;
const isTouch = ev.type.startsWith("touch");
const elem = ev.target as HTMLElement;
elem.classList.add("dragging");
const { left, width } = elem.closest(".slider")!.getBoundingClientRect();
Expand All @@ -109,7 +109,7 @@
{ once: true },
);
function move (ev: MouseEvent | TouchEvent) {
const x = ev instanceof MouseEvent ? ev.clientX : ev.touches[0].clientX;
const x = ("touches" in ev ? ev.touches[0] : ev).clientX;
if (isLeft) {
setValue(0, lim(0, end, (x - left) / width));
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neonmob-trade-enhancements",
"version": "3.3.2",
"version": "3.3.3",
"private": true,
"description": "Adds enhancements to improve trading and usage experience",
"scripts": {
Expand Down

0 comments on commit 2b7d0a2

Please sign in to comment.