diff --git a/lib/src/just_the_tooltip.dart b/lib/src/just_the_tooltip.dart index bb7c22b..ce6606b 100644 --- a/lib/src/just_the_tooltip.dart +++ b/lib/src/just_the_tooltip.dart @@ -748,9 +748,13 @@ abstract class JustTheTooltipState extends State 'Cannot find the box for the given object with context $context', ); } - + + final navigator = Navigator.of(context); final targetSize = box.getDryLayout(const BoxConstraints.tightForFinite()); - final target = box.localToGlobal(box.size.center(Offset.zero)); + final target = box.localToGlobal( + box.size.center(Offset.zero), + ancestor: navigator.context.findRenderObject(), + ); // TODO: Instead of this, change the alignment on // [CompositedTransformFollower]. That way we can allow a user configurable // alignment on where the tooltip ends up.