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) {
|
[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;
|
||||||
|
|||||||
Reference in New Issue
Block a user