react-native-material-kit icon indicating copy to clipboard operation
react-native-material-kit copied to clipboard

After a button is re-enabled after being disabled, the color stays disabled

Open mschipperheyn opened this issue 8 years ago • 0 comments

I have a button that is disabled when a form is submitted and re-enabled after submission fails.

When the button is disabled it is grayed out. But the grayed out state is not removed when disabled is set to false.

const FullWidthBtn = MKButton.coloredButton()
	.withBackgroundColor(styleVars.secondaryColor)
	.build();

const FullWidthButton = ({ children, ...rest }) => (
	<FullWidthBtn {...rest}>
		<Text style={[stylesheet.btn, stylesheet.btnText]}>{children}</Text>
	</FullWidthBtn>
);

[...]

<FullWidthButton onPress={handleSubmit} disabled={submitting}>
	<Text>{intl.formatMessage({ id: 'ui.login' }).toUpperCase()}</Text>
</FullWidthButton>

mschipperheyn avatar Nov 28 '17 00:11 mschipperheyn