diff --git a/frontend/src/tools/kalkulator3d.jsx b/frontend/src/tools/kalkulator3d.jsx index ef38c6d..03b7544 100644 --- a/frontend/src/tools/kalkulator3d.jsx +++ b/frontend/src/tools/kalkulator3d.jsx @@ -48,8 +48,14 @@ function compressImage(file) { // ── Stepper ─────────────────────────────────────────────────────────────────── function Stepper({ label, value, onChange, step, unit, min = 0, hint }) { - const dec = () => onChange(Math.max(min, Math.round((value - step) * 10000) / 10000)); - const inc = () => onChange(Math.round((value + step) * 10000) / 10000); + const [raw, setRaw] = useState(String(value)); + + // Sync wenn value sich von außen ändert (z.B. beim Bearbeiten eines Archiv-Eintrags) + useEffect(() => { setRaw(String(value)); }, [value]); + + const dec = () => { const v = Math.max(min, Math.round((value - step) * 10000) / 10000); onChange(v); setRaw(String(v)); }; + const inc = () => { const v = Math.round((value + step) * 10000) / 10000; onChange(v); setRaw(String(v)); }; + return (