Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RN props option, textInputProps to pass into text input. #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import SettingsList from 'react-native-settings-list';
###### <a href='#top'>Top</a>

## <a name='#new'>New changes/additions</a>
* Added `textInputProps` passed to \<SettingsList.Item> to set other options such as `secureEntry` or `autoCapitalize`
* Ability for an authorization-type component [example updated to show a practical use]
* Allows for complete customization of the TextInput by passing into the two props authPropsUser and authPassPW (overwrites defaults
* Uses existing onPress prop for callback
Expand Down Expand Up @@ -100,6 +101,7 @@ The following props are used:
| authPropsUser | Changes the props for the first TextInput component; overwrites default | React.PropTypes.node |
| authPropsPW | Changes the props for the second TextInput component; overwrites default | React.PropTypes.node |
| itemRef | Sets a `ref` on the TouchableHighlight that SettingsList.Item renders to | React.PropTypes.func |
| textInputProps | RN text input props | React.PropTypes.object |

###### <a href='#top'>Top</a>

Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class SettingsList extends React.Component {
style={item.editableTextStyle ? item.editableTextStyle : styles.editableText}
placeholder = {item.placeholder}
onChangeText={(text) => item.onTextChange(text)}
value={item.value} />
value={item.value}
{...item.textInputProps} />
: null
])
}
Expand Down Expand Up @@ -210,7 +211,7 @@ class SettingsList extends React.Component {
<View style={item.titleBoxStyle ? item.titleBoxStyle : [styles.titleBox, border, {minHeight:item.itemWidth ? item.itemWidth : this.props.defaultItemSize}]}>
{titleInfoPosition === 'Bottom' ?
<View style={{flexDirection:'column',flex:1,justifyContent:'center'}}>
{item.isEditable ? this._itemEditableBlock(item, inde, 'Bottom') : this._itemTitleBlock(item, index, 'Bottom')}
{item.isEditable ? this._itemEditableBlock(item, index, 'Bottom') : this._itemTitleBlock(item, index, 'Bottom')}
</View>
: item.isEditable ? this._itemEditableBlock(item, index) : this._itemTitleBlock(item, index)}

Expand Down