Skip to content

Commit 6fd7404

Browse files
committed
Fix incorrect step value for range input
This caused the range input to be marked as invalid for some images.
1 parent 21af830 commit 6fd7404

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cropt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function setZoomerVal(value: number, zoomer: HTMLInputElement) {
5656
const zMin = parseFloat(zoomer.min);
5757
const zMax = parseFloat(zoomer.max);
5858

59-
zoomer.value = Math.max(zMin, Math.min(zMax, value)).toFixed(4);
59+
zoomer.value = Math.max(zMin, Math.min(zMax, value)).toString();
6060
}
6161

6262
function loadImage(src: string): Promise<HTMLImageElement> {
@@ -177,7 +177,7 @@ export class Cropt {
177177
this.elements.boundary.appendChild(this.elements.overlay);
178178

179179
this.elements.zoomer.type = "range";
180-
this.elements.zoomer.step = "0.0001";
180+
this.elements.zoomer.step = "any";
181181
this.elements.zoomer.value = "1";
182182
this.elements.zoomer.setAttribute("aria-label", "zoom");
183183

0 commit comments

Comments
 (0)