Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Text component has incorrect touch area #20645

Closed
jm-david opened this issue Aug 13, 2018 · 3 comments
Closed

Nested Text component has incorrect touch area #20645

jm-david opened this issue Aug 13, 2018 · 3 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@jm-david
Copy link

Environment

Environment:
  OS: macOS High Sierra 10.13.6
  Node: 9.11.1
  Yarn: Not Found
  npm: 6.3.0
  Watchman: 4.9.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2

Description

When the parent Text component has padding, the touch area for any nested Text components is not calculated correctly (ie. padding offset is not applied).

Reproducible Demo

https://snack.expo.io/H1A3ysRH7

@ggtmtmgg
Copy link
Contributor

You cannot pass onPress() to nested Text.
On Android, nested Text is going to be converted SpannableString and then pass SpannableString to the single TextView.
I don't know how hundled on iOS, but it's supposed to be similar to Android.

If you want to pass onPress to the specific Text, you could do like below.

<Text>
  Hello 
</Text>
<Text style={styles.link} onPress={this.onPressLink.bind(this)}>
  React 
</Text>
<Text>
  Native
</Text>

Expo demo: https://snack.expo.io/Sk3m3EZ87

@stale
Copy link

stale bot commented Nov 13, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 13, 2018
@stale
Copy link

stale bot commented Nov 20, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Nov 20, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants