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

Wrap label? #282

Closed
jaxnz opened this issue May 18, 2020 · 1 comment
Closed

Wrap label? #282

jaxnz opened this issue May 18, 2020 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@jaxnz
Copy link

jaxnz commented May 18, 2020

I am building a web app, that requires a public form to be accessed by mobile. I have created a Textarea using FormBuilderTextField but my label is too long on mobile, and goes outside the field:

image

I have already shrunk the text using:

InputDecoration(
          labelStyle: TextStyle(fontSize: textSize),
),

I understand this may be a flaw in InputDecoration, but is this possible to fix?

@danvick
Copy link
Collaborator

danvick commented May 18, 2020

Hi @jaxnz,
This is a sound suggestion, I've had issues with this myself.

However, this would not be possible without overriding the whole InputDecoration class. This is because overflow: TextOverflow.ellipsis is hard-coded in InputDecoration class.

The only suggestion I can think of at this time is making your own Text label, and leave the decoration option empty. Like so:

Text(
  "What are your first impressions of our center?",
  style: Theme.of(context).inputDecorationTheme.labelStyle,
),
FormBuilderTextField(
  attribute: "text_field",
),

It will not work exactly as the InputDecoration label but at least the whole label will be visible.

@danvick danvick added enhancement New feature or request wontfix This will not be worked on labels May 18, 2020
@jaxnz jaxnz closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants