Skip to content

Commit

Permalink
Add autoCorrect prop
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie committed Jan 8, 2018
1 parent 0eb33d7 commit fa1f377
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ios/RNSearchBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ + (BOOL)requiresMainQueueSetup
RCT_EXPORT_VIEW_PROPERTY(keyboardType, UIKeyboardType)
RCT_EXPORT_VIEW_PROPERTY(keyboardAppearance, UIKeyboardAppearance)
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType, UITextAutocapitalizationType)
RCT_REMAP_VIEW_PROPERTY(autoCorrect, autocorrectionType, UITextAutocorrectionType)
RCT_EXPORT_VIEW_PROPERTY(searchBarStyle, UISearchBarStyle)
RCT_CUSTOM_VIEW_PROPERTY(hideBackground, BOOL, RNSearchBar)
{
Expand Down
2 changes: 2 additions & 0 deletions src/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class SearchBar extends React.PureComponent {
]),
keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']),
autoCapitalize: PropTypes.oneOf(['none', 'words', 'sentences', 'characters']),
autoCorrect: PropTypes.bool,
barStyle: PropTypes.oneOf(['default', 'black']),
searchBarStyle: PropTypes.oneOf(['default', 'prominent', 'minimal']),
editable: PropTypes.bool,
Expand All @@ -62,6 +63,7 @@ class SearchBar extends React.PureComponent {
keyboardType: 'default',
keyboardAppearance: 'default',
autoCapitalize: 'sentences',
autoCorrect: false,
onChange: () => null,
onChangeText: () => null,
onFocus: () => null,
Expand Down
7 changes: 7 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ interface Props {
*/
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'

/**
* If autoCorrect is enabled
*
* Default is false
*/
autoCorrect?: boolean

/**
* Event fired when
*/
Expand Down

0 comments on commit fa1f377

Please sign in to comment.