-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Introduce disabling for Touchable* elements #5931
Introduce disabling for Touchable* elements #5931
Conversation
cc @mkonicek |
@Kureev updated the pull request. |
@facebook-github-bot liar! |
@@ -41,6 +41,10 @@ var TouchableWithoutFeedback = React.createClass({ | |||
React.PropTypes.arrayOf(React.PropTypes.oneOf(View.AccessibilityTraits)), | |||
]), | |||
/** | |||
* Disable all component interactions if value is true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if the value is true / If true, disable all interactions for this component.
Does this work also for Do they still animate if you set disabled to true? Do you want them to animate? Should You could try this in the |
Will do! |
👍 thank you. |
76bbd1c
to
bb304f9
Compare
@mkonicek I've added a "Disabled Touchable*" example to UIExplorer:
Yes
No
No, it should behave like a usual text when disabled
No |
@Kureev updated the pull request. |
animationVelocity={0} | ||
underlayColor="rgb(210, 230, 255)" | ||
style={[styles.row, styles.block]} | ||
onPress={() => console.log('custom THW text - hightlight')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: highlight
OK, let's shipit. The test plan doesn't show whether this disables animations for @facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
I'll make a 2 follow-up PRs:
Thanks for merging this one in, @mkonicek |
Summary:Follow-up PR for fixing typos in #5931 **Test plan (required)** This PR contains only copy changes, so no additional testing is required. **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes #6122 Differential Revision: D2970751 Pulled By: javache fb-gh-sync-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5 shipit-source-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5
Summary:Follow-up PR for #5931: Adding missing `TouchableNativeFeedback` example. **Test plan** - Run UIExplorer on iOS and Android devices [Android] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. There are two new buttons there: `Enabled TouchableNativeFeedback` and `Disabled TouchableNativeFeedback`. Buttons should behave according their titles. [iOS] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. As far as `TouchableNativeFeedback` is supported on Android only, you **wouldn't see** any new buttons there **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes #6123 Differential Revision: D2971021 fb-gh-sync-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839 shipit-source-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839
💯 Awesome, thanks @Kureev! |
haha, you're welcome, @mkonicek 😉 |
Summary:Introduce a `disabled` property for Touchable* components. Fix facebook#2103 Closes facebook#5931 Differential Revision: D2969790 Pulled By: mkonicek fb-gh-sync-id: 570a4ff882219f52f2d2ebef3eb73b1df50a0877 shipit-source-id: 570a4ff882219f52f2d2ebef3eb73b1df50a0877
Summary:Follow-up PR for fixing typos in facebook#5931 **Test plan (required)** This PR contains only copy changes, so no additional testing is required. **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes facebook#6122 Differential Revision: D2970751 Pulled By: javache fb-gh-sync-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5 shipit-source-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5
Summary:Follow-up PR for facebook#5931: Adding missing `TouchableNativeFeedback` example. **Test plan** - Run UIExplorer on iOS and Android devices [Android] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. There are two new buttons there: `Enabled TouchableNativeFeedback` and `Disabled TouchableNativeFeedback`. Buttons should behave according their titles. [iOS] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. As far as `TouchableNativeFeedback` is supported on Android only, you **wouldn't see** any new buttons there **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes facebook#6123 Differential Revision: D2971021 fb-gh-sync-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839 shipit-source-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839
Summary:Follow-up PR for fixing typos in #5931 **Test plan (required)** This PR contains only copy changes, so no additional testing is required. **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes facebook/react-native#6122 Differential Revision: D2970751 Pulled By: javache fb-gh-sync-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5 shipit-source-id: 007ab6e732e88f39c7f392f00b2bd668ebb4d7d5
Summary:Follow-up PR for #5931: Adding missing `TouchableNativeFeedback` example. **Test plan** - Run UIExplorer on iOS and Android devices [Android] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. There are two new buttons there: `Enabled TouchableNativeFeedback` and `Disabled TouchableNativeFeedback`. Buttons should behave according their titles. [iOS] - Go to Touchable* examples and scroll down to the `Disabled Touchable*` section. As far as `TouchableNativeFeedback` is supported on Android only, you **wouldn't see** any new buttons there **Code formatting** This PR code style match the desired [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). cc mkonicek Closes facebook/react-native#6123 Differential Revision: D2971021 fb-gh-sync-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839 shipit-source-id: 3be18bda15b5b495caaf9e4444fd0deb47a44839
Introduce a
disabled
property for Touchable* components.Fix #2103