fix: prevent focus and blur if disabled (#431)

This commit is contained in:
Julian Hundeloh
2018-06-28 14:32:58 +02:00
committed by Satyajit Sahoo
parent 0108b23d33
commit 1795dc2553

View File

@@ -225,6 +225,10 @@ class TextInput extends React.Component<Props, State> {
}).start();
_handleFocus = (...args) => {
if (this.props.disabled) {
return;
}
this.setState({ focused: true });
if (this.props.onFocus) {
@@ -233,6 +237,10 @@ class TextInput extends React.Component<Props, State> {
};
_handleBlur = (...args) => {
if (this.props.disabled) {
return;
}
this.setState({ focused: false });
if (this.props.onBlur) {