From 1795dc255359dc9859c3f70eac535cfebb6dcdde Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Thu, 28 Jun 2018 14:32:58 +0200 Subject: [PATCH] fix: prevent focus and blur if disabled (#431) --- src/components/TextInput.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/TextInput.js b/src/components/TextInput.js index 0f71b8c..0eaed6e 100644 --- a/src/components/TextInput.js +++ b/src/components/TextInput.js @@ -225,6 +225,10 @@ class TextInput extends React.Component { }).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 { }; _handleBlur = (...args) => { + if (this.props.disabled) { + return; + } + this.setState({ focused: false }); if (this.props.onBlur) {