Fix for issue #3181 to maintain cursor position on toggle of secure field. (#3197)

This commit is contained in:
Shripal Soni
2016-11-29 19:36:33 +05:30
committed by Vladimir Enchev
parent 25f5827fbf
commit d43dd159c2

View File

@ -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