From 68f6d0e18371c214edd5bb0fed6d5652c3c2d241 Mon Sep 17 00:00:00 2001 From: Matthew Horan Date: Wed, 28 Feb 2024 17:53:34 -0500 Subject: [PATCH] Use UndoTextInput on LoginForm The hostname TextInput also suffers from https://github.com/facebook/react-native/issues/29572. --- src/usecase/buffers/ui/UndoTextInput.tsx | 2 +- src/usecase/login/LoginForm.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usecase/buffers/ui/UndoTextInput.tsx b/src/usecase/buffers/ui/UndoTextInput.tsx index 9a1a2ad..ef102c1 100644 --- a/src/usecase/buffers/ui/UndoTextInput.tsx +++ b/src/usecase/buffers/ui/UndoTextInput.tsx @@ -5,7 +5,7 @@ type Props = React.ComponentProps; const UndoTextInput = (props: Props): JSX.Element => { const { value, onChangeText, ...rest } = props; - const lastValue = React.useRef(value); + const lastValue = React.useRef(); const textInput = React.useRef(null); const handleChangeText = (textValue: string) => { diff --git a/src/usecase/login/LoginForm.tsx b/src/usecase/login/LoginForm.tsx index e052cbb..bb1e0d1 100644 --- a/src/usecase/login/LoginForm.tsx +++ b/src/usecase/login/LoginForm.tsx @@ -13,6 +13,7 @@ import { import { connect, ConnectedProps } from 'react-redux'; import { StoreState } from '../../store'; import { ConnectionError } from '../../lib/weechat/connection'; +import UndoTextInput from '../buffers/ui/UndoTextInput'; const connector = connect((state: StoreState) => ({ hostname: state.connection.hostname || '', @@ -92,7 +93,7 @@ class LoginForm extends React.Component { Connect to Weechat relay via websocket -