From 5bc2e2d1ddf8aa664b8b574c2de1fbd061ceab10 Mon Sep 17 00:00:00 2001 From: Jo du Plessis Date: Thu, 13 Jun 2024 12:59:50 +0200 Subject: [PATCH] isolate only for virtual --- packages/core/src/select/select.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/select/select.tsx b/packages/core/src/select/select.tsx index c5d696b1..a5fb7d91 100644 --- a/packages/core/src/select/select.tsx +++ b/packages/core/src/select/select.tsx @@ -210,7 +210,17 @@ export const Select = (props: SelectProps) => { onSelect(option, dismiss, clear) // refocus the elment because the forced scrolling (useEffect) // causes the element to lose focus - focusElementById(popupContentId) + if (as == 'virtual') { + if (isFilterable) { + if (tagInput) { + focusElement(tagInputFieldRef.current) + } else { + focusElementById(popupId) + } + } else { + focusElementById(popupContentId) + } + } } const handleClickOutside = (e) => {