Skip to content
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
14 changes: 14 additions & 0 deletions ios/EnrichedTextInputView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,20 @@ - (void)updateProps:(Props::Shared const &)props
}
}

// autoCorrect
if (newViewProps.autoCorrect != oldViewProps.autoCorrect) {
textView.autocorrectionType = newViewProps.autoCorrect
? UITextAutocorrectionTypeYes
: UITextAutocorrectionTypeNo;
}

// spellCheck
if (newViewProps.spellCheck != oldViewProps.spellCheck) {
textView.spellCheckingType = newViewProps.spellCheck
? UITextSpellCheckingTypeYes
: UITextSpellCheckingTypeNo;
}

// isOnChangeHtmlSet
_emitHtml = newViewProps.isOnChangeHtmlSet;

Expand Down
4 changes: 4 additions & 0 deletions src/native/EnrichedTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const EnrichedTextInput = ({
selectionColor,
style,
autoCapitalize = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.autoCapitalize,
autoCorrect,
spellCheck,
Comment on lines +61 to +62
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would explicitly mark them as enabled by default

Suggested change
autoCorrect,
spellCheck,
autoCorrect = true,
spellCheck = true,

htmlStyle = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.htmlStyle,
linkRegex: _linkRegex,
onFocus,
Expand Down Expand Up @@ -333,6 +335,8 @@ export const EnrichedTextInput = ({
selectionColor={selectionColor}
style={style}
autoCapitalize={autoCapitalize}
autoCorrect={autoCorrect}
spellCheck={spellCheck}
htmlStyle={normalizedHtmlStyle}
linkRegex={linkRegex}
onInputFocus={onFocus}
Expand Down
2 changes: 2 additions & 0 deletions src/spec/EnrichedTextInputNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ export interface NativeProps extends ViewProps {
cursorColor?: ColorValue;
selectionColor?: ColorValue;
autoCapitalize?: string;
autoCorrect?: boolean;
spellCheck?: boolean;
htmlStyle?: HtmlStyleInternal;
scrollEnabled?: boolean;
linkRegex?: LinkNativeRegex;
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ export interface EnrichedTextInputProps extends Omit<ViewProps, 'children'> {
cursorColor?: ColorValue;
selectionColor?: ColorValue;
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
autoCorrect?: boolean;
spellCheck?: boolean;
htmlStyle?: HtmlStyle;
style?: ViewStyle | TextStyle;
scrollEnabled?: boolean;
Expand Down