Skip to content

[Components] Changed the width of the compose PilotTextField placeholder view to fillMaxWidth#33

Merged
gbourassa merged 1 commit into
mainfrom
fix/textfield-compose-placeholder
Jan 21, 2026
Merged

[Components] Changed the width of the compose PilotTextField placeholder view to fillMaxWidth#33
gbourassa merged 1 commit into
mainfrom
fix/textfield-compose-placeholder

Conversation

@gbourassa

Copy link
Copy Markdown
Member

The placeholder view used by the PilotTextField is a Text wrapping its width. This was a limitation to get a proper centered textfield.

The proper way to have a centered textfield is to use the text style textAlign. With that field set, the text field text is properly centered, no matter the width of the view

However, it was not possible to get the same behavior for the placeholder, since even when setting its textAlign value, it would still be aligned to the left. The Text content would be centered (but since it wraps its content, it has no effect), but the Text would still be left aligned in its parent.

Setting the placeholder to be as wide as the TextField allows us to have the same behavior for both the actual textField and the placeholder, since they share the same width.

The default behavior remains unchanged, since textAlign default value is start on text styles.

@gbourassa gbourassa merged commit 580d126 into main Jan 21, 2026
1 check passed
@gbourassa gbourassa deleted the fix/textfield-compose-placeholder branch January 21, 2026 15:02
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