mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Fixing crash happening when password toggle is clicked without the edit text having focus in TalkBack mode.
PiperOrigin-RevId: 286590576 (cherry picked from commit 8ed0ab79647374eef3d6b6d2270a00a4f0645803)
This commit is contained in:
parent
c6812b2cd5
commit
d5b2d818c3
@ -99,7 +99,9 @@ class PasswordToggleEndIconDelegate extends EndIconDelegate {
|
||||
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
||||
}
|
||||
// And restore the cursor position
|
||||
editText.setSelection(selection);
|
||||
if (selection >= 0) {
|
||||
editText.setSelection(selection);
|
||||
}
|
||||
}
|
||||
});
|
||||
textInputLayout.addOnEditTextAttachedListener(onEditTextAttachedListener);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user