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

RTL InputDecoration fix #129661

Merged
merged 3 commits into from Jun 28, 2023
Merged

RTL InputDecoration fix #129661

merged 3 commits into from Jun 28, 2023

Conversation

justinmc
Copy link
Contributor

@justinmc justinmc commented Jun 27, 2023

It looks like the wrong padding was being used in the layout logic in RTL mode when using a prefixIcon. This fixes it.

This bug seems to have been in the codebase for 5 years. However, it doesn't manifest itself unless 1. RTL 2. prefixIcon and 3. asymmetric left/right contentPadding, so that's probably why it wasn't reported until now.

Before Screenshot from 2023-06-27 13-10-48
After Screenshot from 2023-06-27 13-11-11

Fixes #129591

Code to reproduce
import 'package:flutter/material.dart';

/// Flutter code sample for [InputDecoration].

void main() => runApp(const InputDecorationExampleApp());

class InputDecorationExampleApp extends StatelessWidget {
  const InputDecorationExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('InputDecoration Sample')),
        body: const Padding(
          padding: EdgeInsets.all(8),
          child: Column(
            children: [
              InputDecorationExample(),
              SizedBox(height: 8),
              Directionality(
                textDirection: TextDirection.rtl,
                child: InputDecorationExample(),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class InputDecorationExample extends StatelessWidget {
  const InputDecorationExample({super.key});

  @override
  Widget build(BuildContext context) {
    return const TextField(
      decoration: InputDecoration(
        contentPadding: EdgeInsetsDirectional.only(end: 24),
        prefixIcon: Icon(Icons.search),
      ),
    );
  }
}

@justinmc justinmc self-assigned this Jun 27, 2023
@justinmc justinmc marked this pull request as ready for review June 27, 2023 20:38
@justinmc justinmc merged commit c751166 into flutter:master Jun 28, 2023
72 checks passed
@justinmc justinmc deleted the rtl-content-padding branch June 28, 2023 23:31
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 29, 2023
camsim99 added a commit to flutter/packages that referenced this pull request Jun 30, 2023
flutter/flutter@51bef1b...ff838bc

2023-06-29 thkim1011@users.noreply.github.com Add locale-specific
DateTime formatting syntax (flutter/flutter#129573)
2023-06-29 tessertaha@gmail.com Update `RadioListTile` tests to M3
(flutter/flutter#129718)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
7fd0e9522ea1 to eabb22900b44 (1 revision) (flutter/flutter#129754)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
d5c25ead07e9 to 7fd0e9522ea1 (2 revisions) (flutter/flutter#129752)
2023-06-29 tjtanjia.tan@gmail.com Fix typos in ListTile examples.
(flutter/flutter#129606)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4e49b9deb72d to d5c25ead07e9 (7 revisions) (flutter/flutter#129750)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
241ca5c1d6be to 4e49b9deb72d (1 revision) (flutter/flutter#129730)
2023-06-29 jacksongardner@google.com Skwasm benchmarks.
(flutter/flutter#129681)
2023-06-28 jmccandless@google.com RTL InputDecoration fix
(flutter/flutter#129661)
2023-06-28 christopherfujino@gmail.com mark autoroller flaky
(flutter/flutter#129745)
2023-06-28 fluttergithubbot@gmail.com Roll pub packages
(flutter/flutter#129380)
2023-06-28 109253501+pdblasi-google@users.noreply.github.com Removes
deprecated APIs from AnimationBuilder (flutter/flutter#129657)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC
camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on
the revert to ensure that a human
is aware of the problem.

To file a bug in Packages:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

---------

Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
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.

Material InputDecoration contentPadding is broken in RTL
2 participants