diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index c319f4c44e..e82d8759e0 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -546,7 +546,7 @@ class App extends React.Component { public library: AppClassProperties["library"]; public libraryItemsFromStorage: LibraryItems | undefined; public id: string; - private store: Store; + store: Store; private history: History; private excalidrawContainerValue: { container: HTMLDivElement | null; diff --git a/packages/excalidraw/components/Stats/DragInput.tsx b/packages/excalidraw/components/Stats/DragInput.tsx index 9f13d2019b..a56d6dbfed 100644 --- a/packages/excalidraw/components/Stats/DragInput.tsx +++ b/packages/excalidraw/components/Stats/DragInput.tsx @@ -7,6 +7,7 @@ import { deepCopyElement } from "../../element/newElement"; import "./DragInput.scss"; import clsx from "clsx"; +import { useApp } from "../App"; export type DragInputCallbackType = ( accumulatedChange: number, @@ -34,6 +35,7 @@ const StatsDragInput = ({ editable = true, shouldKeepAspectRatio, }: StatsDragInputProps) => { + const app = useApp(); const inputRef = useRef(null); const labelRef = useRef(null); @@ -110,6 +112,8 @@ const StatsDragInput = ({ false, ); + app.store.shouldCaptureIncrement(); + lastPointer = null; accumulatedChange = null; stateAtStart = null; @@ -153,6 +157,7 @@ const StatsDragInput = ({ false, v, ); + app.store.shouldCaptureIncrement(); eventTarget.blur(); } } diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts index a9cc47d974..a72dbfccfd 100644 --- a/packages/excalidraw/types.ts +++ b/packages/excalidraw/types.ts @@ -592,6 +592,7 @@ export type AppClassProperties = { files: BinaryFiles; device: App["device"]; scene: App["scene"]; + store: App["store"]; pasteFromClipboard: App["pasteFromClipboard"]; id: App["id"]; onInsertElements: App["onInsertElements"];