Skip to content

Commit 1c78f20

Browse files
(Lookup): set the initial scope
1 parent 6900cfe commit 1c78f20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scripts/Lookup.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ const LookupScopeSelector: FC<LookupScopeSelectorProps> = ({
234234
const [scopeOpened, setScopeOpened] = useState(false);
235235
const [scopeFocusedIndex, setScopeFocusedIndex] = useState<number>(-1);
236236

237-
const currentScope = scopes.find((scope) => scope.label === targetScope);
237+
const currentScope =
238+
scopes.find((scope) => scope.label === targetScope) ?? scopes[0];
238239

239240
// Scroll focused scope element into view
240241
const scrollFocusedScopeIntoView = useEventCallback(

0 commit comments

Comments
 (0)