Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextField parameter ordering and sizing shenanigans #285

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

rock3r
Copy link
Collaborator

@rock3r rock3r commented Jan 14, 2024

This PR fixes two issues:

  1. The two TextField composables differ in the orders of their trailingIcon and leadingIcon parameters #284
  2. TextField layout logic:
  • When there is a placeholder and leading and/or trailing icons, if the text field doesn't have a fixed width, the width jumps around
  • In many cases, when the text field doesn't have a fixed height, focusing it or typing in it causes its height to change
Before After
Before After

The fix for the second issue is to not consider the placeholder in the size calculation, which was a weird choice anyway. We likely inherited it from the Material EditText, that served as inspiration, but handles the placeholder very differently than we do.

Closes #284 and updates the sample code to use IconButton.

@rock3r rock3r added bug Something isn't working consistency Our UI presentation is not consistent with IJ api Changes related to the public API labels Jan 14, 2024
@rock3r rock3r added this to the Milestone 13 milestone Jan 14, 2024
@rock3r rock3r requested review from devkanro and fscarponi January 14, 2024 15:30
@rock3r rock3r self-assigned this Jan 14, 2024
@rock3r rock3r modified the milestones: Milestone 13, Milestone 14 Jan 14, 2024
@rock3r rock3r merged commit 6131b37 into main Jan 15, 2024
12 checks passed
@rock3r rock3r deleted the 284-textfield-parameter-ordering branch January 15, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Changes related to the public API bug Something isn't working consistency Our UI presentation is not consistent with IJ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The two TextField composables differ in the orders of their trailingIcon and leadingIcon parameters
2 participants