TextInput broken with writingDirection
Open
Nobody has claimed this yet.
Component: TextInput
Issue: Author Provided Repro
Needs: React Native Team Attention
- Dominant language
- C++
- Stars
- 127k
- Forks
- 25.3k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Description
TextInput UI was broken with writingDirection, both ltr and rtl. It will display correctly if we focus the input
import { TextInput, View } from 'react-native'
export default function HomeScreen() {
return (
<View style={{ flex: 1, paddingTop: 50, backgroundColor: '#FFF' }}>
<View style={{ flexDirection: 'row', gap: 8 }}>
<TextInput
value={
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Velit morbi nisi aptent condimentum nisi fringilla rutrum sociis senectus ac. Torquent mauris risus ultricies aenean vitae erat mollis congue dui mus'
}
placeholder='Enter your text here'
numberOfLines={1}
multiline={false}
style={{
borderWidth: 1,
borderColor: 'black',
borderRadius: 5,
alignSelf: 'stretch',
writingDirection: 'rtl',
paddingHorizontal: 2,
height: 40
}}
/>
</View>
</View>
)
}
Steps to reproduce
Use the code snippet above
React Native Version
0.81.5
Affected Platforms
Runtime - iOS
Output of npx @react-native-community/cli info
% npx @react-native-community/cli info
error: unknown command 'info'
(Did you mean init?)
Stacktrace or Logs
none
MANDATORY Reproducer
https://github.com/maphongba008/input-writing-direction-issue
Screenshots and Videos
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the mandatory reproducer at https://github.com/maphongba008/input-writing-direction-issue with React Native 0.81.5 on iOS, using the supplied TextInput example and testing both ltr and rtl writingDirection values. Done means the text renders correctly before the input receives focus, without relying on focusing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100