Skip to content

Commit

Permalink
Use UndoTextInput on LoginForm
Browse files Browse the repository at this point in the history
The hostname TextInput also suffers from
facebook/react-native#29572.
  • Loading branch information
mhoran committed Feb 28, 2024
1 parent 045dbcf commit 68f6d0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/usecase/buffers/ui/UndoTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Props = React.ComponentProps<typeof TextInput>;

const UndoTextInput = (props: Props): JSX.Element => {
const { value, onChangeText, ...rest } = props;
const lastValue = React.useRef(value);
const lastValue = React.useRef<string>();
const textInput = React.useRef<TextInput>(null);

const handleChangeText = (textValue: string) => {
Expand Down
3 changes: 2 additions & 1 deletion src/usecase/login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand Down Expand Up @@ -92,7 +93,7 @@ class LoginForm extends React.Component<Props, State> {
<Text style={styles.header}>
Connect to Weechat relay via websocket
</Text>
<TextInput
<UndoTextInput
style={styles.input}
placeholderTextColor="#4157af"
keyboardType="url"
Expand Down

0 comments on commit 68f6d0e

Please sign in to comment.