Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ProgressiveInput extends Component {
clearButtonColor: PropTypes.string,
clearButtonSize: PropTypes.number,
clearButtonStyle: PropTypes.object,
clearButtonEnabled: PropTypes.bool,
activityIndicatorStyle: ActivityIndicator.propTypes.style,
onBlur: PropTypes.func,
onChangeText: PropTypes.func,
Expand Down Expand Up @@ -105,7 +106,7 @@ class ProgressiveInput extends Component {
};

_renderClearButton = () => {
if (this.state.showClearButton) {
if (this.state.showClearButton && this.props.clearButtonEnabled) {
return (
<TouchableOpacity onPress={() => this.clearInput()}>
<Ionicons
Expand Down Expand Up @@ -140,7 +141,12 @@ class ProgressiveInput extends Component {
this.setState({ showClearButton });
};

_onBlur = () => this.setState({ showClearButton: false });
_onBlur = () => {
this.setState({ showClearButton: false })
if (this.props.onBlur) {
this.props.onBlur();
}
};
}

const styles = StyleSheet.create({
Expand Down