Skip to content

fix: allow login fields to grow beyond 60dp so text isn't clipped - #477

Open
M-archand wants to merge 1 commit into
ssalggnikool:masterfrom
M-archand:master
Open

fix: allow login fields to grow beyond 60dp so text isn't clipped#477
M-archand wants to merge 1 commit into
ssalggnikool:masterfrom
M-archand:master

Conversation

@M-archand

Copy link
Copy Markdown
Contributor

Issue

On the login screen, text typed into the Instance URL, Username, and Password fields rendered too low inside the field. Bottoms of characters like g, q, y, p were clipping badly at the bottom edge of the field, making the text look cut off.
navic-login-before

Cause

All three login fields apply a fixed Modifier.height(60.dp) to their OutlinedTextField/OutlinedSecureTextField. A fixed height overrides Material3's own sizing logic, which sets 56dp as a min and grows the field to fit the label + the full text line box.

These three fields were the only text fields in the codebase I could find with a hardcoded height, and the only ones showing the bug.

Fix

Replaced Modifier.height(60.dp) with Modifier.heightIn(min = 60.dp) on all three fields. This keeps 60dp as a floor so the layout looks the same, but lets Material3 grow the field the few extra dp it needs to fit the text.

Tests

Tested on my Android 17 device: typed characters like g & q into the login fields and confirmed they all render fully without anymore clipping, the rest of the login screen layout is unaffected.

UI Screenshot (after change applied)

navic-login-after

@ssalggnikool

ssalggnikool commented Aug 13, 2026

Copy link
Copy Markdown
Owner

the reason why I set the height to 60.dp is because material 3 expressive applies a really ugly bounce animation when you focus/unfocus text fields, setting height to 60.dp makes it not do that, unless you fixed that i don’t want this

this is another case of me not putting good code comments on anything to explain why i did something lol

@M-archand

Copy link
Copy Markdown
Contributor Author

@ssalggnikool The repo is on material3 1.12.0-alpha03, and on that version heightIn vs height makes no difference to the bounce, it doesn't occur either way. I've confirmed with device testing that the field focus animation is identical with and without this PR. The 60.dp workaround (which is what causes the clipping) was added in April 2026 against material3 1.11.0-alpha04, the bounce it suppressed no longer occurs after the 1.12.0-alpha bump, so the clamp only has the downside now from what I can tell 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants