fix: disappearing hover effect on popover trigger (#1403)

This commit is contained in:
Eakam 2022-11-01 09:01:35 -04:00 committed by GitHub
parent 9c8d00bb61
commit cd8e4ddf00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 12 deletions

View File

@ -96,7 +96,6 @@ class Popover extends StatefulWidget {
class PopoverState extends State<Popover> {
static final RootOverlayEntry _rootEntry = RootOverlayEntry();
final PopoverLink popoverLink = PopoverLink();
Timer? _debounceEnterRegionAction;
@override
void initState() {
@ -175,16 +174,9 @@ class PopoverState extends State<Popover> {
return MouseRegion(
onEnter: (event) {
_debounceEnterRegionAction =
Timer(const Duration(milliseconds: 200), () {
if (widget.triggerActions & PopoverTriggerFlags.hover != 0) {
showOverlay();
}
});
},
onExit: (event) {
_debounceEnterRegionAction?.cancel();
_debounceEnterRegionAction = null;
if (widget.triggerActions & PopoverTriggerFlags.hover != 0) {
showOverlay();
}
},
child: Listener(
child: widget.child,

View File

@ -51,7 +51,7 @@ class _FlowyHoverState extends State<FlowyHover> {
return MouseRegion(
cursor: widget.cursor != null ? widget.cursor! : SystemMouseCursors.click,
opaque: false,
onEnter: (p) {
onHover: (p) {
if (_onHover) return;
if (widget.buildWhenOnHover?.call() ?? true) {