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

TextArea can't auto-size based on content #630

Open
rock3r opened this issue Oct 15, 2024 · 0 comments
Open

TextArea can't auto-size based on content #630

rock3r opened this issue Oct 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rock3r
Copy link
Collaborator

rock3r commented Oct 15, 2024

When you have a BTF:

Box(
  Modifier.heightIn(min = minTextAreaHeight, max = maxTextAreaHeight),
  contentAlignment = Alignment.TopStart,
) {
  BasicTextField(state = myState, modifier = Modifier.fillMaxWidth())
}

It will size itself based on the number of text lines in the state, and the heightIn modifier. When empty, it matches the min; when there are too many lines to fit in the max it'll stop growing and start scrolling.

However, the same does not happen with TextArea:

Box(
  Modifier.heightIn(min = minTextAreaHeight, max = maxTextAreaHeight),
  contentAlignment = Alignment.TopStart,
) {
  TextArea(state = myState, modifier = Modifier.fillMaxWidth())
}

The TextArea will always stretch until max, regardless of its text contents.

@rock3r rock3r added the bug Something isn't working label Oct 15, 2024
@rock3r rock3r self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant