From b830b18b9621c13e94313db842a32f3cfea55608 Mon Sep 17 00:00:00 2001 From: iapolya Date: Fri, 31 Jan 2025 19:27:11 +0300 Subject: [PATCH] fix(Select): keyboard behavior on mobile --- src/components/Select/Select.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx index 392d046d16..28208a9966 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/Select/Select.tsx @@ -164,7 +164,10 @@ export const Select = React.forwardRef(function if (multiple) { const activeItemIndex = listRef?.current?.getActiveItem(); - filterRef.current?.focus(); + + if (!mobile) { + filterRef.current?.focus(); + } if (typeof activeItemIndex === 'number') { // prevent item deactivation in case of multiple selection @@ -178,7 +181,7 @@ export const Select = React.forwardRef(function handleSelection(option); }, - [handleSelection, multiple], + [handleSelection, mobile, multiple], ); const handleControlKeyDown = React.useCallback( @@ -249,6 +252,7 @@ export const Select = React.forwardRef(function }, [handleClose, onBlur], ), + isDisabled: mobile, }); const uniqId = useUniqId();