Skip to content

🎥 Make videos programmatically with React

@remotion/studio: Match dropdown typeahead on visible label, not quickSwitcherLabel

Jonny Burgera28d40a2ca50
diff --git a/packages/studio/src/components/NewComposition/menu-typeahead.ts b/packages/studio/src/components/NewComposition/menu-typeahead.ts
index 8e97afde2a..e4a0d808e6 100644
--- a/packages/studio/src/components/NewComposition/menu-typeahead.ts
+++ b/packages/studio/src/components/NewComposition/menu-typeahead.ts
@@ -5,10 +5,6 @@ const getLabelToMatch = (value: ComboboxValue): string | null => {
return null;
}
- if (value.quickSwitcherLabel) {
- return value.quickSwitcherLabel;
- }
-
if (typeof value.label === 'string') {
return value.label;
}
diff --git a/packages/studio/src/test/menu-typeahead.test.ts b/packages/studio/src/test/menu-typeahead.test.ts
index 192450ada2..e53cb39dc4 100644
--- a/packages/studio/src/test/menu-typeahead.test.ts
+++ b/packages/studio/src/test/menu-typeahead.test.ts
@@ -55,8 +55,9 @@ test('ignores divider and disabled items', () => {
expect(findTypeaheadMenuItem({query: 'ban', values})).toBe(null);
});
-test('prefers quickSwitcherLabel if available', () => {
- expect(findTypeaheadMenuItem({query: 'custom', values})).toBe('custom');
+test('matches visible label when quickSwitcherLabel differs', () => {
+ expect(findTypeaheadMenuItem({query: 'custom', values})).toBe(null);
+ expect(findTypeaheadMenuItem({query: 'not', values})).toBe('custom');
});
test('returns null for empty or unmatched query', () => {