mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-11 16:29:43 +08:00
fix: prevent focus and blur if disabled (#431)
This commit is contained in:
committed by
Satyajit Sahoo
parent
0108b23d33
commit
1795dc2553
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user