Skip to content

Commit 81cd66f

Browse files
koplyarovgorhom
authored andcommitted
fix(BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmount (#1495)(by @koplyarov)
1 parent b81cb93 commit 81cd66f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/bottomSheetTextInput/BottomSheetTextInput.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { memo, useCallback, forwardRef } from 'react';
1+
import React, { memo, useCallback, forwardRef, useEffect } from 'react';
22
import type {
33
TextInputFocusEventData,
44
NativeSyntheticEvent,
@@ -36,6 +36,14 @@ const BottomSheetTextInputComponent = forwardRef<
3636
);
3737
//#endregion
3838

39+
//#region effects
40+
useEffect(() => {
41+
return () => {
42+
// Reset the flag on unmount
43+
shouldHandleKeyboardEvents.value = false;
44+
};
45+
}, [shouldHandleKeyboardEvents]);
46+
//#endregion
3947
return (
4048
<TextInput
4149
ref={ref}

0 commit comments

Comments
 (0)