-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/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 onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
DraggableScrollableSheet does not prevent pointer hover events from passing through.
Steps to Reproduce
main.dart
A UI that stacks a DraggableScrollableSheet on top of the page content.
also includes an example of a workaround
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(title: 'Flutter dss-hover-pass-through bug', home: MyHomePage());
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Scaffold(
appBar: AppBar(
title: Text('DraggableScrollableSheet hover-pass-through bug'),
actions: <Widget>[
IconButton(
icon: Icon(Icons.info), tooltip: "Action tooltip", onPressed: () {}),
],
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'The button below and the appbar action above should not receive hover events when covered by the DraggableScrollableSheet.'
' To demonstrate, drag the red sheet over the buttons and mouse over them. The tooltips will display when they should not.'
' The blue sheet implements a workaround by wrapping its content with a MouseRegion widget.',
),
),
Tooltip(
message: 'Button tooltip',
child: RaisedButton(child: Text('Button'), onPressed: () {}),
),
],
),
),
),
// A sheet through which the hover events will pass-through.
DraggableScrollableSheet(
initialChildSize: .2,
maxChildSize: 1,
minChildSize: .2,
builder: (BuildContext _, ScrollController sc) {
return Card(
color: Colors.red[100],
child: SingleChildScrollView(
controller: sc,
child: Center(child: Text("DraggableScrollableSheet")),
),
);
},
),
// A sheet with a workaround for the bug.
DraggableScrollableSheet(
initialChildSize: .1,
maxChildSize: 1,
minChildSize: .1,
builder: (BuildContext _, ScrollController sc) {
return MouseRegion(
child: Card(
color: Colors.lightBlue[100],
child: SingleChildScrollView(
controller: sc,
child: Center(child: Text("DraggableScrollableSheet with workaround")),
),
),
);
},
),
],
);
}
}Expected results:
The content hidden by the DraggableScrollableSheet to not react to mouse hover events.
Actual results:
Tooltips triggered by mouse hover events are shown for content hidden by the DraggableScrollableSheet.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/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 onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team