Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Fix floating point math issue in scrub (#1562)
Roman Pominovbcdfc9f83dfe
diff --git a/packages/design-system/src/components/primitives/numeric-gesture-control.ts b/packages/design-system/src/components/primitives/numeric-gesture-control.tsindex eb147f3508..a345c32eae 100644--- a/packages/design-system/src/components/primitives/numeric-gesture-control.ts+++ b/packages/design-system/src/components/primitives/numeric-gesture-control.ts@@ -57,7 +57,8 @@ const getValueDefault = (maxValue = Number.MAX_SAFE_INTEGER,}: NumericScrubOptions) => {- const value = state.value + movement;+ // toFixed is needed to fix `1.3 - 1 = 0.30000000000000004`+ const value = Number((state.value + movement).toFixed(2));if (value < minValue) {return minValue;}