Skip to content

Commit 740a3d2

Browse files
n0tnullwcshi
authored andcommitted
[TextInputLayout] Fixed clear icon being displayed when the text field is not focused.
Resolves #2025 Resolves #2024 GIT_ORIGIN_REV_ID=19a520a8d44cbb62e307fd4dde251cd7ca97da42 PiperOrigin-RevId: 366032778
1 parent fed90a9 commit 740a3d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/java/com/google/android/material/textfield/ClearTextEndIconDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void afterTextChanged(@NonNull Editable s) {
5656
if (textInputLayout.getSuffixText() != null) {
5757
return;
5858
}
59-
animateIcon(hasText(s));
59+
animateIcon(textInputLayout.hasFocus() && hasText(s));
6060
}
6161
};
6262
private final OnFocusChangeListener onFocusChangeListener =

0 commit comments

Comments
 (0)