fix issue undo history number input

This commit is contained in:
wass08
2026-02-10 11:00:11 +09:00
parent daf41f7da5
commit 4dd85993cb
2 changed files with 9 additions and 5 deletions
@@ -73,9 +73,15 @@ export function NumberInput({
document.removeEventListener('mousemove', handleMouseMove)
document.removeEventListener('mouseup', handleMouseUp)
// Resume history tracking and commit final value
useScene.temporal.getState().resume()
onChange(finalValue)
// Reset to initial value while still paused (no history entry)
// Then resume and apply final value (creates single history entry)
if (finalValue !== startValueRef.current) {
onChange(startValueRef.current)
useScene.temporal.getState().resume()
onChange(finalValue)
} else {
useScene.temporal.getState().resume()
}
}
document.addEventListener('mousemove', handleMouseMove)