|
|
@ -7,6 +7,7 @@ import { deepCopyElement } from "../../element/newElement";
|
|
|
|
|
|
|
|
|
|
|
|
import "./DragInput.scss";
|
|
|
|
import "./DragInput.scss";
|
|
|
|
import clsx from "clsx";
|
|
|
|
import clsx from "clsx";
|
|
|
|
|
|
|
|
import { useApp } from "../App";
|
|
|
|
|
|
|
|
|
|
|
|
export type DragInputCallbackType = (
|
|
|
|
export type DragInputCallbackType = (
|
|
|
|
accumulatedChange: number,
|
|
|
|
accumulatedChange: number,
|
|
|
@ -34,6 +35,7 @@ const StatsDragInput = ({
|
|
|
|
editable = true,
|
|
|
|
editable = true,
|
|
|
|
shouldKeepAspectRatio,
|
|
|
|
shouldKeepAspectRatio,
|
|
|
|
}: StatsDragInputProps) => {
|
|
|
|
}: StatsDragInputProps) => {
|
|
|
|
|
|
|
|
const app = useApp();
|
|
|
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
|
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
|
|
const labelRef = useRef<HTMLDivElement>(null);
|
|
|
|
const labelRef = useRef<HTMLDivElement>(null);
|
|
|
|
|
|
|
|
|
|
|
@ -110,6 +112,8 @@ const StatsDragInput = ({
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.store.shouldCaptureIncrement();
|
|
|
|
|
|
|
|
|
|
|
|
lastPointer = null;
|
|
|
|
lastPointer = null;
|
|
|
|
accumulatedChange = null;
|
|
|
|
accumulatedChange = null;
|
|
|
|
stateAtStart = null;
|
|
|
|
stateAtStart = null;
|
|
|
@ -153,6 +157,7 @@ const StatsDragInput = ({
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
v,
|
|
|
|
v,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
app.store.shouldCaptureIncrement();
|
|
|
|
eventTarget.blur();
|
|
|
|
eventTarget.blur();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|