[Nested Text Android] onPress hitbox has an incorrect size.
See original GitHub issue- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
Run react-native info
in your terminal and paste its contents here.
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 55.39 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.2 - /usr/local/bin/node
Yarn: 1.3.2 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 26, 27
Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
Description
Nested Texts with an onPress do not allow you te press on the whole word. Texts nested in a View work correctly. This only happens on Android IOS seems fine.
Reproducible Demo
Init a new react native project. Change default App component to:
<View style={styles.container}>
<Text>
<Text onPress={ () => {console.warn('Hello!')} } style={styles.welcome}>facebook.com</Text>
</Text>
</View>
The last letter from facebook.com will not respond to the onPress.
A Text nested directly in a View it works as expected:
<View style={styles.container}>
<Text onPress={ () => {console.warn('Hello!')} } style={styles.welcome}>facebook.com</Text>
</View>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:14 (1 by maintainers)
Top Results From Across the Web
html - Enlarging a Specific Area of Clickable Nested Text
You can wrap the text you want to be pressable into a Pressable component and then increase the tappable area by using the...
Read more >Unreal Engine 4.11 Release Notes
This release brings hundreds of updates for Unreal Engine 4, including 92 improvements submitted by the community of Unreal Engine developers on GitHub!...
Read more >@material-ui/core | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >React native modal bottom sheet examples pdf download ...
page not showing react on window resize react onblur react onChange react functional programming onchange text input react native onclick ...
Read more >Diff - platform/packages/inputmethods/LatinIME
This onPress call may have changed keyboard layout. ... hitBoxWidth = hitBox.width(); final int hitBoxHeight = hitBox.height(); final float hitBoxDiagonal ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s not fixed.
@bobsmits I found that this is an issue when
Text
has padding in the style. Even if the padding is assigned to the top levelText
, the hitbox for childText
elements seems to break.