Skip to content

Commit cd8e4dd

Browse files
authored
fix: disappearing hover effect on popover trigger (#1403)
1 parent 9c8d00b commit cd8e4dd

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

frontend/app_flowy/packages/appflowy_popover/lib/src/popover.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class Popover extends StatefulWidget {
9696
class PopoverState extends State<Popover> {
9797
static final RootOverlayEntry _rootEntry = RootOverlayEntry();
9898
final PopoverLink popoverLink = PopoverLink();
99-
Timer? _debounceEnterRegionAction;
10099

101100
@override
102101
void initState() {
@@ -175,16 +174,9 @@ class PopoverState extends State<Popover> {
175174

176175
return MouseRegion(
177176
onEnter: (event) {
178-
_debounceEnterRegionAction =
179-
Timer(const Duration(milliseconds: 200), () {
180-
if (widget.triggerActions & PopoverTriggerFlags.hover != 0) {
181-
showOverlay();
182-
}
183-
});
184-
},
185-
onExit: (event) {
186-
_debounceEnterRegionAction?.cancel();
187-
_debounceEnterRegionAction = null;
177+
if (widget.triggerActions & PopoverTriggerFlags.hover != 0) {
178+
showOverlay();
179+
}
188180
},
189181
child: Listener(
190182
child: widget.child,

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class _FlowyHoverState extends State<FlowyHover> {
5151
return MouseRegion(
5252
cursor: widget.cursor != null ? widget.cursor! : SystemMouseCursors.click,
5353
opaque: false,
54-
onEnter: (p) {
54+
onHover: (p) {
5555
if (_onHover) return;
5656

5757
if (widget.buildWhenOnHover?.call() ?? true) {

0 commit comments

Comments
 (0)