mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): ensure autocorrect not applied silently on IOS16 (#10032)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user