Skip to content

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.

fixed types

Sultan94332b3f73a2
diff --git a/app/shared/design-system/components/primitives/createContentController.stories.tsx b/app/shared/design-system/components/primitives/createContentController.stories.tsx
index 091859f1a8..79d2b58a09 100644
--- a/app/shared/design-system/components/primitives/createContentController.stories.tsx
+++ b/app/shared/design-system/components/primitives/createContentController.stories.tsx
@@ -13,6 +13,7 @@ const useContentController = ({
callback: (value: { name: string; value: string }) => void;
}) => {
useEffect(() => {
+ if (ref.current == null) return;
const { disconnectedCallback } = createContentController(ref.current, {
contents: [
{
@@ -23,7 +24,7 @@ const useContentController = ({
name: "number",
match: (value: string) => isNaN(parseFloat(value)) === false,
},
- { name: "unknown", match: (value: string) => value },
+ { name: "unknown", match: (value: string) => Boolean(value) },
],
read,
write,
diff --git a/app/shared/design-system/components/primitives/createContentController.ts b/app/shared/design-system/components/primitives/createContentController.ts
index 667c05c01b..47662fed25 100644
--- a/app/shared/design-system/components/primitives/createContentController.ts
+++ b/app/shared/design-system/components/primitives/createContentController.ts
@@ -72,7 +72,6 @@ export const createContentController = (
write: (node: HTMLInputElement, value: string) => void;
contents: {
name: string;
- value: string;
match: (value: string) => boolean;
}[];
onMouseMove: (value: {