Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: incorrect popover position (#7452)

Richard Shiue2dd7e5937f33
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart
index 3561bd33a0..9e0b241ab3 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart
@@ -1,8 +1,7 @@
import 'dart:io';
import 'package:appflowy/generated/flowy_svgs.g.dart';
-import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
-import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart';
+import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
class BlockActionButton extends StatelessWidget {
@@ -23,15 +22,17 @@ class BlockActionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
- Widget child = MouseRegion(
- cursor: Platform.isWindows
- ? SystemMouseCursors.click
- : SystemMouseCursors.grab,
- child: IgnoreParentGestureWidget(
- onPress: onPointerDown,
- child: GestureDetector(
- onTap: onTap,
- behavior: HitTestBehavior.deferToChild,
+ return FlowyTooltip(
+ richMessage: showTooltip ? richMessage : null,
+ child: FlowyIconButton(
+ width: 18.0,
+ hoverColor: Colors.transparent,
+ iconColorOnHover: Theme.of(context).iconTheme.color,
+ onPressed: onTap,
+ icon: MouseRegion(
+ cursor: Platform.isWindows
+ ? SystemMouseCursors.click
+ : SystemMouseCursors.grab,
child: FlowySvg(
svg,
size: const Size.square(18.0),
@@ -40,14 +41,5 @@ class BlockActionButton extends StatelessWidget {
),
),
);
-
- if (showTooltip) {
- child = FlowyTooltip(
- richMessage: richMessage,
- child: child,
- );
- }
-
- return child;
}
}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_button.dart
index 29dabd0da1..4efb1a55b2 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_button.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_button.dart
@@ -50,7 +50,6 @@ class _BlockOptionButtonState extends State<BlockOptionButton> {
child: BlocBuilder<BlockActionOptionCubit, BlockActionOptionState>(
builder: (context, _) => PopoverActionList<PopoverAction>(
actions: _buildPopoverActions(context),
- popoverMutex: PopoverMutex(),
animationDuration: Durations.short3,
slideDistance: 5,
beginScaleFactor: 1.0,