Closed as not planned
Description
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Given a hierarchy of views:
<View>
with onLayout prop<View>
that hasposition: 'absolute'
style- A TextInput
Text inside the TextInput can't be selected. Removing the first view's onLayout prop or the second view's position: 'absolute'
will allow text in the TextInput to be selected.
React Native version:
v0.62.2
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Render inside a component the following:
import * as React from 'react';
import { TextInput, View, Text } from 'react-native';
export default function App() {
return (
<View style={{ flex: 1 }}>
{
// Remove the onLayout for the text to become selectable
}
<View onLayout={() => {}}>
<View
style={{
position: 'absolute',
width: '100%',
top: 50,
paddingHorizontal: 8,
}}
>
<Text style={{ marginBottom: 10 }} wrap>
The following text should be selectable. For some reason, it's not
selectable on Android when placed inside the original
KeyboardAvoidingView or any View with an onLayout callback.
</Text>
<TextInput defaultValue="Try selecting this text" />
</View>
</View>
</View>
);
}
- On Android, try to select text inside the TextInput
Expected Results
Describe what you expected to happen.
The text should be selected
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@harrytravelchime/react-native-issue-29308