From e5efc3614d7cc338bc4a5669ba107fd4da08b75b Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 5 Feb 2024 19:37:07 -0600 Subject: [PATCH] Scope tag input query selector --- src/components/TagInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TagInput.tsx b/src/components/TagInput.tsx index 5f348e12..c7f7b4b3 100644 --- a/src/components/TagInput.tsx +++ b/src/components/TagInput.tsx @@ -89,7 +89,7 @@ export default function TagInput({ // Focus option in the DOM when selected index changes useEffect(() => { if (selectedOptionIndex !== undefined) { - const options = optionsRef.current?.querySelectorAll('div'); + const options = optionsRef.current?.querySelectorAll(':scope > div'); const option = options?.[selectedOptionIndex] as HTMLElement | undefined; option?.focus(); }