diff --git a/tns-core-modules/ui/text-field/text-field.android.ts b/tns-core-modules/ui/text-field/text-field.android.ts index 1f29772f6..95ad65d02 100644 --- a/tns-core-modules/ui/text-field/text-field.android.ts +++ b/tns-core-modules/ui/text-field/text-field.android.ts @@ -8,6 +8,7 @@ function onSecurePropertyChanged(data: dependencyObservable.PropertyChangeData) return; } + var cursorPosition = textField.android.getSelectionStart(); var currentInputType = textField.android.getInputType(); var currentClass = currentInputType & android.text.InputType.TYPE_MASK_CLASS; var currentFlags = currentInputType & android.text.InputType.TYPE_MASK_FLAGS; @@ -35,6 +36,7 @@ function onSecurePropertyChanged(data: dependencyObservable.PropertyChangeData) } textField.android.setInputType(newInputType); + textField.android.setSelection(cursorPosition); } // register the setNativeValue callbacks