Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Make deleteTagOnPress match the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterp committed Dec 10, 2018
1 parent 5097df3 commit fbfc4f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
33 changes: 16 additions & 17 deletions Tags/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Tags extends React.Component {
style,
tagContainerStyle,
tagTextStyle,
deleteOnTagPress,
deleteTagOnPress,
onTagPress,
readonly,
maxNumberOfTags,
Expand All @@ -88,7 +88,7 @@ class Tags extends React.Component {
key={i}
label={tag}
onPress={e => {
if (deleteOnTagPress) {
if (deleteTagOnPress) {
this.setState(
{
tags: [
Expand All @@ -112,19 +112,18 @@ class Tags extends React.Component {
/>
))}

{!readonly &&
maxNumberOfTags > this.state.tags.length && (
<View style={[styles.textInputContainer, inputContainerStyle]}>
<TextInput
{...textInputProps}
value={this.state.text}
style={[styles.textInput, inputStyle]}
onChangeText={this.onChangeText}
onSubmitEditing={this.onSubmitEditing}
underlineColorAndroid="transparent"
/>
</View>
)}
{!readonly && maxNumberOfTags > this.state.tags.length && (
<View style={[styles.textInputContainer, inputContainerStyle]}>
<TextInput
{...textInputProps}
value={this.state.text}
style={[styles.textInput, inputStyle]}
onChangeText={this.onChangeText}
onSubmitEditing={this.onSubmitEditing}
underlineColorAndroid="transparent"
/>
</View>
)}
</View>
);
}
Expand All @@ -136,7 +135,7 @@ Tags.defaultProps = {
createTagOnString: [",", " "],
createTagOnReturn: false,
readonly: false,
deleteOnTagPress: true,
deleteTagOnPress: true,
maxNumberOfTags: Number.POSITIVE_INFINITY
};

Expand All @@ -148,7 +147,7 @@ Tags.propTypes = {
onChangeTags: PropTypes.func,
readonly: PropTypes.bool,
maxNumberOfTags: PropTypes.number,
deleteOnTagPress: PropTypes.bool,
deleteTagOnPress: PropTypes.bool,
containerStyle: PropTypes.any,
style: PropTypes.any,
inputContainerStyle: PropTypes.any,
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "react-native-tags",
"version": "1.7.0",
"version": "1.8.0",
"description": "Tag input component for React Native",
"keywords": [
"react native",
"tags",
"tag input"
],
"main": "index.js",
"scripts": {
"test": "jest",
Expand Down

0 comments on commit fbfc4f8

Please sign in to comment.