Skip to content

Commit 3fd9b3c

Browse files
authored
Fix input loses focus when switching to another tab (#736)
1 parent 0e8acfc commit 3fd9b3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/MarkdownTextInput.web.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
605605
const handleBlur: FocusEventHandler<HTMLDivElement> = useCallback(
606606
(event) => {
607607
const e = event as unknown as NativeSyntheticEvent<TextInputFocusEventData>;
608-
RNTextInput.State.blurTextInput?.(e.target);
608+
if (event.target !== document.activeElement) {
609+
RNTextInput.State.blurTextInput?.(e.target);
610+
}
609611
removeSelection();
610612
currentlyFocusedField.current = null;
611613
if (onBlur) {

0 commit comments

Comments
 (0)