Skip to content

Commit

Permalink
fix(BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmount (
Browse files Browse the repository at this point in the history
  • Loading branch information
koplyarov authored and gorhom committed Sep 6, 2023
1 parent b81cb93 commit 81cd66f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/bottomSheetTextInput/BottomSheetTextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, useCallback, forwardRef } from 'react';
import React, { memo, useCallback, forwardRef, useEffect } from 'react';
import type {
TextInputFocusEventData,
NativeSyntheticEvent,
Expand Down Expand Up @@ -36,6 +36,14 @@ const BottomSheetTextInputComponent = forwardRef<
);
//#endregion

//#region effects
useEffect(() => {
return () => {
// Reset the flag on unmount
shouldHandleKeyboardEvents.value = false;
};
}, [shouldHandleKeyboardEvents]);
//#endregion
return (
<TextInput
ref={ref}
Expand Down

0 comments on commit 81cd66f

Please sign in to comment.