Scope tag input query selector
This commit is contained in:
parent
e330330147
commit
e5efc3614d
@ -89,7 +89,7 @@ export default function TagInput({
|
|||||||
// Focus option in the DOM when selected index changes
|
// Focus option in the DOM when selected index changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedOptionIndex !== undefined) {
|
if (selectedOptionIndex !== undefined) {
|
||||||
const options = optionsRef.current?.querySelectorAll('div');
|
const options = optionsRef.current?.querySelectorAll(':scope > div');
|
||||||
const option = options?.[selectedOptionIndex] as HTMLElement | undefined;
|
const option = options?.[selectedOptionIndex] as HTMLElement | undefined;
|
||||||
option?.focus();
|
option?.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user