fix(ios): ensure autocorrect not applied silently on IOS16 (#10032)

This commit is contained in:
Jason Cassidy
2022-11-08 16:46:52 +00:00
committed by GitHub
parent b7d340f69b
commit 40b9e3578f

View File

@@ -214,15 +214,21 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
} }
[autocorrectProperty.setNative](value: boolean | number) { [autocorrectProperty.setNative](value: boolean | number) {
let newValue: UITextAutocorrectionType; let newValue: UITextAutocorrectionType;
let spelling: UITextSpellCheckingType;
if (typeof value === 'number') { if (typeof value === 'number') {
newValue = UITextAutocorrectionType.Default; newValue = UITextAutocorrectionType.Default;
spelling = UITextSpellCheckingType.Default;
} else if (value) { } else if (value) {
newValue = UITextAutocorrectionType.Yes; newValue = UITextAutocorrectionType.Yes;
spelling = UITextSpellCheckingType.Yes;
} else { } else {
newValue = UITextAutocorrectionType.No; newValue = UITextAutocorrectionType.No;
spelling = UITextSpellCheckingType.No;
} }
this.nativeTextViewProtected.autocorrectionType = newValue; this.nativeTextViewProtected.autocorrectionType = newValue;
this.nativeTextViewProtected.spellCheckingType = spelling;
} }
public setSelection(start: number, stop?: number) { public setSelection(start: number, stop?: number) {
const view = this.nativeTextViewProtected; const view = this.nativeTextViewProtected;