Skip to content

Conversation

@TahaTesser
Copy link
Member

fixes Chip's delete button tap target is too big

Description

This PR fixes the issue where the chip delete button is tappable within the label.

Code sample

expand to view the code sample
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(useMaterial3: true),
      home: const Example(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Sample'),
      ),
      body: Center(
        child: Chip(
          label: const Text('Really Long Label'),
          onDeleted: () {},
        ),
      ),
    );
  }
}

Before

Screen.Recording.2023-07-19.at.15.38.10.mov

After

Screen.Recording.2023-07-19.at.15.37.30.mov

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 19, 2023
@TahaTesser TahaTesser marked this pull request as ready for review July 19, 2023 16:55
@TahaTesser TahaTesser requested a review from gspencergoog July 19, 2023 16:55
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 20, 2023
@auto-submit auto-submit bot merged commit f92637d into flutter:master Jul 20, 2023
@TahaTesser TahaTesser deleted the fix_chip_delete_tap_target branch July 20, 2023 09:31
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 20, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 20, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 20, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 21, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 21, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 21, 2023
Roll Flutter from d07e8ae to 9cfbf6b (58 revisions)

flutter/flutter@d07e8ae...9cfbf6b

2023-07-21 engine-flutter-autoroll@skia.org Roll Packages from 674179f to 2266a76 (6 revisions) (flutter/flutter#131058)
2023-07-21 jhy03261997@gmail.com Add tests for navigation_drawer_theme_test.dart  (flutter/flutter#130465)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from f812cf373b6b to f5c1650c7acc (1 revision) (flutter/flutter#131037)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from 264685f0aecb to f812cf373b6b (1 revision) (flutter/flutter#131032)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8ff10f5a7667 to 264685f0aecb (1 revision) (flutter/flutter#131031)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from b5a6b1c9cba5 to 8ff10f5a7667 (5 revisions) (flutter/flutter#131029)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from 218b71cd7a45 to b5a6b1c9cba5 (1 revision) (flutter/flutter#131025)
2023-07-21 engine-flutter-autoroll@skia.org Roll Flutter Engine from ab7d424d4467 to 218b71cd7a45 (2 revisions) (flutter/flutter#131024)
2023-07-21 stuartmorgan@google.com Use downgraded analyze for flutter/packages (flutter/flutter#130878)
2023-07-21 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#131022)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9b2ebf2afe00 to ab7d424d4467 (4 revisions) (flutter/flutter#131015)
2023-07-20 gspencergoog@users.noreply.github.com Add applyFocusChangeIfNeeded, have menus restore focus before activating (flutter/flutter#130536)
2023-07-20 christopherfujino@gmail.com Migrate more integration tests to process result matcher (flutter/flutter#130994)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 062079ba30b6 to 9b2ebf2afe00 (2 revisions) (flutter/flutter#131013)
2023-07-20 ian@hixie.ch Trivial grammar and wrapping fix for docs (flutter/flutter#130955)
2023-07-20 hans.muller@gmail.com Updated the ThemeData API example (flutter/flutter#130954)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from a3fc18514cd6 to 062079ba30b6 (3 revisions) (flutter/flutter#131010)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6d7842d25f81 to a3fc18514cd6 (2 revisions) (flutter/flutter#131007)
2023-07-20 36861262+QuncCccccc@users.noreply.github.com Update `TextSelectionTheme`, `ThemeData`, `TimePicker`, and `TimePickerTheme` tests for M2/M3 (flutter/flutter#130547)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from c645eb6da8a9 to 6d7842d25f81 (1 revision) (flutter/flutter#130992)
2023-07-20 leroux_bruno@yahoo.fr Update AutoComplete test for M3 migration (flutter/flutter#130883)
2023-07-20 leroux_bruno@yahoo.fr Update about tests for M3 (flutter/flutter#130970)
2023-07-20 engine-flutter-autoroll@skia.org Roll Packages from 209db21 to 674179f (4 revisions) (flutter/flutter#130989)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from e40995da7869 to c645eb6da8a9 (1 revision) (flutter/flutter#130988)
2023-07-20 polinach@google.com Upgrade leak_tracker. (flutter/flutter#130951)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2df3b9c4b2a4 to e40995da7869 (2 revisions) (flutter/flutter#130985)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from b494143fb0bc to 2df3b9c4b2a4 (3 revisions) (flutter/flutter#130973)
2023-07-20 tessertaha@gmail.com Fix chip delete button tap target spilling into the label. (flutter/flutter#130896)
2023-07-20 leroux_bruno@yahoo.fr Fix IconButton leaks its internal MaterialStatesController (flutter/flutter#130720)
2023-07-20 leroux_bruno@yahoo.fr Update banner_theme_test.dart for M3 (flutter/flutter#130884)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 204625490ca1 to b494143fb0bc (1 revision) (flutter/flutter#130966)
2023-07-20 chingjun@google.com Make PollingDeviceDiscovery start the initial poll faster. (flutter/flutter#130755)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from c902fec1e3ce to 204625490ca1 (1 revision) (flutter/flutter#130962)
2023-07-20 ian@hixie.ch More documentation for MediaQuery and friends (flutter/flutter#130509)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 56e88e8b0eef to c902fec1e3ce (1 revision) (flutter/flutter#130960)
2023-07-20 ian@hixie.ch Automatically create the layer when setting hints in PaintingContext (flutter/flutter#130364)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from e2a36be2f084 to 56e88e8b0eef (1 revision) (flutter/flutter#130959)
2023-07-20 ian@hixie.ch Further clarify Stack documentation on overflowing (flutter/flutter#130776)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from eff70f7287f9 to e2a36be2f084 (2 revisions) (flutter/flutter#130956)
2023-07-20 47866232+chunhtai@users.noreply.github.com Can traverse if current focused node skips traversal (flutter/flutter#130812)
2023-07-20 ian@hixie.ch Document that you can't change initialRoute usefully (flutter/flutter#130450)
2023-07-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7671e2f2a9fc to eff70f7287f9 (3 revisions) (flutter/flutter#130953)
2023-07-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 938140a974b0 to 7671e2f2a9fc (3 revisions) (flutter/flutter#130948)
2023-07-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0af285219809 to 938140a974b0 (1 revision) (flutter/flutter#130943)
2023-07-19 ian@hixie.ch Add docs to Route.maintainState (flutter/flutter#130638)
2023-07-19 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.20.4 to 2.21.0 (flutter/flutter#130941)
...
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…30896)

fixes [Chip's delete button tap target is too big](flutter#129986)

### Description 

This PR fixes the issue where the chip delete button is tappable within the label. 

### Code sample

<details> 
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

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

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

  @OverRide
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(useMaterial3: true),
      home: const Example(),
    );
  }
}

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

  @OverRide
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Sample'),
      ),
      body: Center(
        child: Chip(
          label: const Text('Really Long Label'),
          onDeleted: () {},
        ),
      ),
    );
  }
}
``` 
	
</details>

### Before

https://github.com/flutter/flutter/assets/48603081/14b369c5-c740-4dfc-a512-779bd3a1a46b

### After

https://github.com/flutter/flutter/assets/48603081/08c6e232-0237-4ab2-9829-66ee8e5cead2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chip's delete button tap target is too big

2 participants