diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index a93833a8..1d437c50 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -13,7 +13,7 @@ import type { } from 'react-native'; import React, {useEffect, useRef, useCallback, useMemo, useLayoutEffect} from 'react'; import type {CSSProperties, MutableRefObject, ReactEventHandler, FocusEventHandler, MouseEvent, KeyboardEvent, SyntheticEvent, ClipboardEventHandler, TouchEvent} from 'react'; -import {StyleSheet} from 'react-native'; +import {StyleSheet, TextInput as RNTextInput} from 'react-native'; import {updateInputStructure} from './web/utils/parserUtils'; import InputHistory from './web/InputHistory'; import type {TreeNode} from './web/utils/treeUtils'; @@ -553,6 +553,7 @@ const MarkdownTextInput = React.forwardRef { hasJustBeenFocused.current = true; const e = event as unknown as NativeSyntheticEvent; + RNTextInput.State.focusTextInput?.(e.target); const hostNode = e.target as unknown as HTMLDivElement; currentlyFocusedField.current = hostNode; setEventProps(e); @@ -600,6 +601,7 @@ const MarkdownTextInput = React.forwardRef = useCallback( (event) => { const e = event as unknown as NativeSyntheticEvent; + RNTextInput.State.blurTextInput?.(e.target); removeSelection(); currentlyFocusedField.current = null; if (onBlur) {