Open Aiiros opened 5 years ago
A dirty workaround is to make the input multiline only when it is touched (to scroll)
import { useState } from 'react';
import { TextInput as RNTextInput } from 'react-native';
function TextInput({ multiline, innerRef, ...props }) {
const [isMultiline, setIsMultiline] = useState(false);
return (
<RNTextInput
ref={innerRef}
{...props}
onTouchStart={() => setIsMultiline(true)}
onTouchEnd={() => setIsMultiline(false)}
onTouchCancel={() => setIsMultiline(false)}
onTouchMove={() => setIsMultiline(false)}
multiline={multiline || isMultiline}
/>
);
}
export default TextInput;
still issue
In a too long form, scroll is only available if the touch start outside the
TextInput
fieldsReact Native version:
Steps To Reproduce
flex: 1
Describe what you expected to happen:
I expect the page to scroll
Snack, code example, or link to a repository:
snack: https://snack.expo.io/@aiiros/react-native-issue-25594
this is a duplicate of https://github.com/facebook/react-native/issues/15962 which has not yet been answered.
Edit: Turns out
textAlign='center'
is causing all of this