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) {
let newValue: UITextAutocorrectionType;
let spelling: UITextSpellCheckingType;
if (typeof value === 'number') {
newValue = UITextAutocorrectionType.Default;
spelling = UITextSpellCheckingType.Default;
} else if (value) {
newValue = UITextAutocorrectionType.Yes;
spelling = UITextSpellCheckingType.Yes;
} else {
newValue = UITextAutocorrectionType.No;
spelling = UITextSpellCheckingType.No;
}
this.nativeTextViewProtected.autocorrectionType = newValue;
this.nativeTextViewProtected.spellCheckingType = spelling;
}
public setSelection(start: number, stop?: number) {
const view = this.nativeTextViewProtected;