Move cursor to the end to fix the jumping cursor bug.

Fixes #2469
This commit is contained in:
Onuray Sahin 2020-11-30 18:12:26 +03:00
parent 93ffb116b7
commit 2736247d09
2 changed files with 3 additions and 0 deletions

View file

@ -9,6 +9,7 @@ Improvements 🙌:
Bugfix 🐛:
- Double bottomsheet effect after verify with passphrase
- EditText cursor jumps to the start while typing fast (#2469)
Translations 🗣:
-

View file

@ -67,6 +67,8 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
// Update only if text is different and value is not null
if (value != null && holder.textInputEditText.text.toString() != value) {
holder.textInputEditText.setText(value)
// To fix jumping cursor to the start https://github.com/airbnb/epoxy/issues/426
holder.textInputEditText.setSelection(value?.length ?: 0)
}
holder.textInputEditText.isEnabled = enabled
inputType?.let { holder.textInputEditText.inputType = it }