From a36a0aec384958778864f7842627f21a9fb31bf8 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 16 Jul 2025 11:55:48 -0400
Subject: fixed undo of property number sliders.

---
 src/client/views/PropertiesView.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/client/views/PropertiesView.tsx')

diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 06463b2a2..5211272b0 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -1187,6 +1187,7 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
     setFinalNumber = () => {
         this._sliderKey = '';
         this._sliderBatch?.end();
+        this._sliderBatch = undefined;
     };
 
     getNumber = (label: string, unit: string, min: number, max: number, number: number, setNumber: (val: number) => void, autorange?: number, autorangeMinVal?: number) => {
@@ -1198,7 +1199,6 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
                     key={key}
                     onPointerDown={() => {
                         this._sliderKey = key;
-                        this._sliderBatch = UndoManager.StartBatch('slider ' + label);
                     }}
                     multithumb={false}
                     color={this.color}
@@ -1211,7 +1211,10 @@ export class PropertiesView extends ObservableReactComponent<PropertiesViewProps
                     unit={unit}
                     decimals={1}
                     setFinalNumber={this.setFinalNumber}
-                    setNumber={setNumber}
+                    setNumber={e => {
+                        if (!this._sliderBatch) this._sliderBatch = UndoManager.StartBatch('slider ' + label);
+                        setNumber(e);
+                    }}
                     fillWidth
                 />
             </div>
-- 
cgit v1.2.3-70-g09d2

