Skip to content

Floating label on InputDecoration is truncated even when it could fit #56848

Closed

Description

@mehmetf

b/154950540

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SizedBox(
          width: 300,
          child: InputDecorator(
            decoration: InputDecoration(
              labelText: 'Long1 long2 long3 long4 long5 long6 text',
              border: OutlineInputBorder(
                borderSide: BorderSide(width: 1),
                borderRadius: BorderRadius.all(Radius.circular(4)),
              ),
            ),
            child: Text(''),
          ),
        ),
      ),
    );
  }
}

Activity

  1. mehmetf commented on May 10, 2020

    @mehmetf
    ContributorAuthor

    This might be a restriction in Material Design language. We are double checking.

  2. mehmetf commented on May 10, 2020

    @mehmetf
    ContributorAuthor
  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on May 11, 2020
  4. willlarche commented on May 11, 2020

    @willlarche
    Contributor

    Speaking with Design.

  5. willlarche commented on May 11, 2020

    @willlarche
    Contributor

    The X of the label should be max(standard padding, end of shaped corner). AKA, the start of the label is the start of the text field minus the standard padding (or the end of a shaped corner if larger). The point of the label at which to truncate should mirror that: the max width of the label should be the width of the whole text field minus the max(standard padding, end of shaped corner)*2.

  6. mehmetf commented on May 11, 2020

    @mehmetf
    ContributorAuthor

    Ack.

    Seems like we have to fix this in the framework. Just a heads up that this issue might be bumped to critical soon. I am waiting for Mulligan to tell me whether they are failing Material review.

  7. github-actions commented on Aug 20, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer: mulligan (g3)frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions