diff --git a/ios/RNSearchBarManager.m b/ios/RNSearchBarManager.m index 9b8a804..4c10e7a 100644 --- a/ios/RNSearchBarManager.m +++ b/ios/RNSearchBarManager.m @@ -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) { diff --git a/src/SearchBar.js b/src/SearchBar.js index d7af52e..a947e5c 100644 --- a/src/SearchBar.js +++ b/src/SearchBar.js @@ -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, @@ -62,6 +63,7 @@ class SearchBar extends React.PureComponent { keyboardType: 'default', keyboardAppearance: 'default', autoCapitalize: 'sentences', + autoCorrect: false, onChange: () => null, onChangeText: () => null, onFocus: () => null, diff --git a/src/index.d.ts b/src/index.d.ts index c1a4ecb..60f10ac 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -109,6 +109,13 @@ interface Props { */ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters' + /** + * If autoCorrect is enabled + * + * Default is false + */ + autoCorrect?: boolean + /** * Event fired when */