File tree Expand file tree Collapse file tree
lib/java/com/google/android/material/textfield Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1875,11 +1875,17 @@ public void onClick(View view) {
18751875 });
18761876 }
18771877
1878- if (editText != null && ViewCompat .getMinimumHeight (editText ) <= 0 ) {
1879- // We should make sure that the EditText has the same min-height as the password toggle
1880- // view. This ensures focus works properly, and there is no visual jump if the password
1881- // toggle is enabled/disabled.
1882- editText .setMinimumHeight (ViewCompat .getMinimumHeight (passwordToggleView ));
1878+ if (editText .getMeasuredHeight () < passwordToggleView .getMeasuredHeight ()) {
1879+ // We need to make sure that the EditText's height is at least the same as the password
1880+ // toggle's height. This ensures focus works properly, and there is no visual jump if the
1881+ // password toggle is enabled/disabled.
1882+ editText .setMinimumHeight (passwordToggleView .getMeasuredHeight ());
1883+ editText .post (new Runnable () {
1884+ @ Override
1885+ public void run () {
1886+ editText .requestLayout ();
1887+ }
1888+ });
18831889 }
18841890
18851891 passwordToggleView .setVisibility (VISIBLE );
You can’t perform that action at this time.
0 commit comments