File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
frontend/app_flowy/packages/flowy_infra_ui/lib Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import 'package:flowy_infra/theme_extension.dart';
22import 'package:flowy_infra/size.dart' ;
33import 'package:flowy_infra_ui/style_widget/hover.dart' ;
44import 'package:flowy_infra_ui/style_widget/text.dart' ;
5+ import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart' ;
56import 'package:flowy_infra_ui/widget/spacing.dart' ;
67import 'package:flutter/material.dart' ;
78import 'package:textstyle_extensions/textstyle_extensions.dart' ;
@@ -176,7 +177,12 @@ class FlowyTextButton extends StatelessWidget {
176177 highlightColor: Colors .transparent,
177178 elevation: 0 ,
178179 constraints: constraints,
179- onPressed: onPressed,
180+ onPressed: () {},
181+ child: child,
182+ );
183+
184+ child = IgnoreParentGestureWidget (
185+ onPress: onPressed,
180186 child: child,
181187 );
182188
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+ class IgnoreParentGestureWidget extends StatelessWidget {
4+ const IgnoreParentGestureWidget ({
5+ Key ? key,
6+ required this .child,
7+ this .onPress,
8+ }) : super (key: key);
9+
10+ final Widget child;
11+ final VoidCallback ? onPress;
12+
13+ @override
14+ Widget build (BuildContext context) {
15+ // https://docs.flutter.dev/development/ui/advanced/gestures#gesture-disambiguation
16+ // https://github.com/AppFlowy-IO/AppFlowy/issues/1290
17+ return Listener (
18+ onPointerDown: (event) {
19+ onPress? .call ();
20+ },
21+ onPointerSignal: (event) {},
22+ onPointerMove: (event) {},
23+ onPointerUp: (event) {},
24+ onPointerHover: (event) {},
25+ onPointerPanZoomStart: (event) {},
26+ onPointerPanZoomUpdate: (event) {},
27+ onPointerPanZoomEnd: (event) {},
28+ child: child,
29+ );
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments