Skip to content

🎥 Make videos programmatically with React

test out combobox bugs

Jonny Burger138ff6250d64
diff --git a/packages/cli/src/editor/components/Menu/styles.ts b/packages/cli/src/editor/components/Menu/styles.ts
index e9eb55cffc..c2b9fa96d5 100644
--- a/packages/cli/src/editor/components/Menu/styles.ts
+++ b/packages/cli/src/editor/components/Menu/styles.ts
@@ -10,6 +10,8 @@ const menuContainer: React.CSSProperties = {
color: 'white',
userSelect: 'none',
minWidth: 200,
+ maxHeight: 400,
+ overflow: 'auto',
};
export const SHADOW_TOWARDS_BOTTOM = '0 2px 8px rgba(0, 0, 0, 0.5)';
diff --git a/packages/cli/src/editor/components/NewComposition/ComboBox.tsx b/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
index 3be1fd97cd..ba74707427 100644
--- a/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
+++ b/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
@@ -146,6 +146,10 @@ export const Combobox: React.FC<{
};
}, [refresh]);
+ // TODO: Limit width
+ // TODO: Align to left if more space on the right
+ // TODO: Scroll to current value if there are a lot of values
+
const portalStyle = useMemo((): React.CSSProperties | null => {
if (!opened || !size) {
return null;
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
index bca0835acd..c5f99933a9 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
@@ -112,6 +112,8 @@ export const SchemaEditor: React.FC<{
const defaultPropsValid = schema.safeParse(defaultProps);
if (!defaultPropsValid.success) {
+ // TODO: Layout is not nice
+ // TODO: Does not react to when schema is updated
return (
<div>
<div style={errorExplanation}>
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index 04b4feb1c6..8dad529fad 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -711,6 +711,34 @@ export const Index: React.FC = () => {
values: z.enum(['a', 'b', 'c']),
supersuperlongvalueabcdefghji: z.string(),
incompatible: z.null().or(z.undefined()),
+ longEnum: z.enum([
+ 'a',
+ 'b',
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ 'gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg',
+ 'h',
+ 'i',
+ 'j',
+ 'k',
+ 'l',
+ 'm',
+ 'n',
+ 'o',
+ 'p',
+ 'q',
+ 'r',
+ 's',
+ 't',
+ 'u',
+ 'v',
+ 'w',
+ 'x',
+ 'y',
+ 'z',
+ ]),
})}
defaultProps={{
vehicle: 'car' as const,
@@ -736,6 +764,7 @@ export const Index: React.FC = () => {
values: 'a' as const,
supersuperlongvalueabcdefghji: 'hi' as const,
incompatible: null,
+ longEnum: 'a' as const,
}}
durationInFrames={150}
/>