Skip to content

Commit a3d356f

Browse files
leticiarossihunterstich
authored andcommitted
[TextInputLayout] Fixing placeholder not respecting edit text's gravity.
Resolves: material-components#1139 PiperOrigin-RevId: 304037224
1 parent 4e28d9c commit a3d356f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,8 +2691,7 @@ private void updatePlaceholderMeasurementsBasedOnEditText() {
26912691
if (placeholderTextView != null && editText != null) {
26922692
// Use the EditText's positioning for the placeholder.
26932693
final int editTextGravity = this.editText.getGravity();
2694-
placeholderTextView.setGravity(
2695-
Gravity.TOP | (editTextGravity & ~Gravity.VERTICAL_GRAVITY_MASK));
2694+
placeholderTextView.setGravity(editTextGravity);
26962695

26972696
placeholderTextView.setPadding(
26982697
editText.getCompoundPaddingLeft(),

0 commit comments

Comments
 (0)