Skip to content

Chip delete button tap target does not meet platform recommended tap target size #94098

@NickAb

Description

@NickAb

Reopening #42455 Chip delete button tap target is too small.

Steps to Reproduce

  1. Add androidTapTargetGuideline test case to packages/flutter/test/material/chip_test.dart. See code below.
      testWidgets('delete button tap target complies with minimum tap target guideline', (WidgetTester tester) async {
        final SemanticsHandle handle = tester.ensureSemantics();
        final UniqueKey deleteKey = UniqueKey();
        await tester.pumpWidget(
          _wrapForChip(
            child: Column(
              children: <Widget>[
                Chip(
                  label: const Text('Label'),
                  deleteIcon: Icon(Icons.delete, key: deleteKey),
                  onDeleted: () { },
                ),
              ],
            ),
          ),
        );
    
        await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
    
        handle.dispose();
      });
  2. Execute cd packages/flutter and flutter test flutter/test/material/chip_test.dart

Expected results:

  • All tests pass

Actual results:

  • delete button tap target complies with minimum tap target guideline [E] fails with
    Expected: Tappable objects should be at least Size(48.0, 48.0)
    Actual: <Instance of 'WidgetTester'>
    Which: SemanticsNode#5(Rect.fromLTRB(90.0, 12.0, 114.0, 36.0), actions: [tap], flags: [isButton,
    isFocusable], label: "Delete", textDirection: ltr): expected tap target size of at least Size(48.0,
    48.0), but found Size(24.0, 24.0)
            See also: https://support.google.com/accessibility/android/answer/7101858?hl=en
    
Flutter Doctor
[✓] Flutter (Channel unknown, 2.6.0-12.0.pre.805, on Debian GNU/Linux rodete 5.10.46-5rodete1-amd64, locale en_US.utf8)
    • Flutter version 2.6.0-12.0.pre.805 at /usr/local/google/home/abalov/flutter
    • Upstream repository unknown
    • Framework revision aee9ade8e3 (60 minutes ago), 2021-11-23 04:03:03 -0500
    • Engine revision f4cb61cefc
    • Dart version 2.16.0 (build 2.16.0-36.0.dev)
    • DevTools version 2.8.0

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: chalk (g3)f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions