Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ const UselessComponent = () => (

## Props

| PropName | Description | Default |
| ----------------- | ------------------------------------------ | -------- |
| initialText | The input element's text | |
| initialTags | ['the', 'initial', 'tags'] | |
| onChangeTags | Fires when tags are added or removed | |
| maxNumberOfTags | The max number of tags that can be entered | infinity |
| onTagPress | Fires when tags are pressed | |
| readonly | Tags cannot be modified | false |
| deleteTagOnPress | Remove the tag when pressed | true |
| containerStyle | Style | |
| style | Style (`containerStyle` alias) | |
| inputStyle | Style | |
| tagContainerStyle | Style | |
| tagTextStyle | Style | |
| PropName | Description | Default |
| ------------------- | ------------------------------------------ | -------- |
| initialText | The input element's text | |
| initialTags | ['the', 'initial', 'tags'] | |
| onChangeTags | Fires when tags are added or removed | |
| maxNumberOfTags | The max number of tags that can be entered | infinity |
| onTagPress | Fires when tags are pressed | |
| readonly | Tags cannot be modified | false |
| deleteTagOnPress | Remove the tag when pressed | true |
| containerStyle | Style | |
| style | Style (`containerStyle` alias) | |
| inputContainerStyle | Style | |
| inputStyle | Style | |
| tagContainerStyle | Style | |
| tagTextStyle | Style | |
1 change: 1 addition & 0 deletions Tags/__tests__/__snapshots__/Tags-tests.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ exports[`Tags should render props correctly 1`] = `
"margin": 4,
"minWidth": 100,
},
undefined,
]
}
>
Expand Down
20 changes: 11 additions & 9 deletions Tags/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import { View, Text, TextInput, TouchableOpacity } from "react-native";
import { View, TextInput, ViewPropTypes } from "react-native";

import Tag from "./Tag";
import styles from "./styles";
Expand Down Expand Up @@ -65,7 +65,8 @@ class Tags extends React.Component {
onTagPress,
readonly,
maxNumberOfTags,
inputStyle
inputStyle,
inputContainerStyle
} = this.props;

return (
Expand Down Expand Up @@ -101,7 +102,7 @@ class Tags extends React.Component {

{!readonly &&
maxNumberOfTags > this.state.tags.length && (
<View style={[styles.textInputContainer]}>
<View style={[styles.textInputContainer, inputContainerStyle]}>
<TextInput
value={this.state.text}
style={[styles.textInput, inputStyle]}
Expand All @@ -127,14 +128,15 @@ Tags.propTypes = {
initialText: PropTypes.string,
initialTags: PropTypes.arrayOf(PropTypes.string),
onChangeTags: PropTypes.func,
containerStyle: PropTypes.object,
style: PropTypes.object,
inputStyle: PropTypes.object,
tagContainerStyle: PropTypes.object,
tagTextStyle: PropTypes.object,
readonly: PropTypes.bool,
maxNumberOfTags: PropTypes.number,
deleteOnTagPress: PropTypes.bool
deleteOnTagPress: PropTypes.bool,
containerStyle: ViewPropTypes.style,
style: ViewPropTypes.style,
inputContainerStyle: ViewPropTypes.style,
inputStyle: ViewPropTypes.style,
tagContainerStyle: ViewPropTypes.style,
tagTextStyle: ViewPropTypes.style
};

export { Tag };
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-tags",
"version": "1.3.0",
"version": "1.5.0",
"description": "Tag input component for React Native",
"main": "index.js",
"scripts": {
Expand All @@ -14,8 +14,8 @@
"author": "Peter Pistorius <peter.pistorius@gmail.com> (http://github.com/peterp/)",
"license": "MIT",
"peerDependencies": {
"react": "*",
"react-native": "*"
"react": ">= 16.0",
"react-native": ">= 0.44"
},
"devDependencies": {
"babel-jest": "^22.4.3",
Expand Down