-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Description
On a chip with a delete button but without onPressed, there is currently no ripple on the delete button when it is pressed.
Behavior before merging #42779
- Tapping on a chip with only
onPressedcreates one ripple; - Tapping on a chip with
onPressedandonDeletedon the delete icon creates two ripples, one for the whole chip and one for the delete icon; (unexpected) - Tapping on a chip with only
onDeletedcreates one ripple; - Tapping on a chip with neither
onPressednoronDeletedcreates no ripples.
(Highlights are not counted as ripples.)
The pull request #42779 fixes the issue b/140930220; after #42779, there is only one ripple when the delete icon is tapped on a chip with onPressed and onDeleted. But this pull request creates the following behavior:
Behavior after merging #42779 (current master)
- Tapping on a chip with only
onPressedcreates one ripple; - Tapping on a chip with
onPressedandonDeletedon the delete icon creates one ripple for the delete icon only; - Tapping on a chip with only
onDeletedcreates no ripples; (unexpected) - Tapping on a chip with neither
onPressednoronDeletedcreates no ripples.
(Tapping the delete button still calls onDeleted as expected. Holding down the delete button still shows a tooltip.)
Expected behavior
- Tapping on a chip with only
onPressedcreates one ripple; - Tapping on a chip with
onPressedandonDeletedon the delete icon creates one ripple for the delete icon only; - Tapping on a chip with only
onDeletedcreates one ripple for the delete icon only; - Tapping on a chip with neither
onPressednoronDeletedcreates no ripples.
Clarifications are needed for the following behavior:
- When a chip with a delete button is pressed (on the delete button), should the whole chip be highlighted?
- When a chip with a delete button is pressed (on the delete button), should the whole chip be elevated?
Related issues
- b/140930220
- This issue is blocking PR [Chip] Make sure InkResponse is in the foreground on delete for chips with background color #41463 (has caused [Chip] Make sure InkResponse is in the foreground on delete for chips with background color #41463 to be reverted).
Steps to reproduce
- Create a new flutter project and save the following code as
main.dart. - Run the project (with flutter on branch
master). - Press and hold different parts of each chip to see how the ripples behave.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RawChip(
label: Text('Chip with onPressed'),
onPressed: () {},
),
RawChip(
label: Text('Chip with onPressed and onDeleted'),
onDeleted: () {},
onPressed: () {},
),
RawChip(
label: Text('Chip with onDeleted only'),
onDeleted: () {},
),
RawChip(
label: Text('Inactive chip'),
),
],
),
),
);
}
}Screenshots
Metadata
Metadata
Assignees
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version





