Fix disabled state - #78
Conversation
ide
commented
Feb 8, 2019
When the button's |
brunobar79
commented
Feb 9, 2019
That’s what I expected to happen in theory but didn’t work in practice. Feel free to close it if you are sure this is not an issue. |
ide
commented
Feb 9, 2019
If there's an issue I'd like to understand the root cause before merging this. If you can figure out what's going on and explain the behavior you're seeing I'd be happy to take another look. |
Here you can see a repro: https://snack.expo.io/rkkqn3jVV Scenario 1) Scenario 2) TL;DR: In this PR, the issue is gone by passing the disabled prop to the This might be a bug on the react-native side and not on this repo but I thought it wouldn't hurt to get t working as expected without too much work. EDIT: Sorry, I didn't mean to close it! |
If you create a button with disabled={true} and then set it to disabled={false} the opacity doesn't change (the container style still looks disabled because the opacity is still applied).
Passing the disabled prop to the touchable opacity component fixes this issue.
Before the fix:

After the fix: