diff --git a/lib/src/controls/flyouts/menu.dart b/lib/src/controls/flyouts/menu.dart index 19ead5a4..b027b7e5 100644 --- a/lib/src/controls/flyouts/menu.dart +++ b/lib/src/controls/flyouts/menu.dart @@ -650,7 +650,9 @@ class _SubItemPositionDelegate extends SingleChildLayoutDelegate { @override BoxConstraints getConstraintsForChild(BoxConstraints constraints) { - return constraints.loosen(); + // The margin should include a top and a bottom + final maxHeight = constraints.maxHeight - margin * 2; + return constraints.loosen().copyWith(maxHeight: maxHeight); } @override @@ -688,6 +690,7 @@ class _SubItemPositionDelegate extends SingleChildLayoutDelegate { if (willOverflowY) { y = parentRect.top + parentRect.height - flyoutSize.height; + if (y < margin) y = margin; } return Offset(x, y);