Skip to content

Commit

Permalink
fix(menu): boundary (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa authored Nov 18, 2024
2 parents f327a58 + c28b1a7 commit f28c133
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/controls/flyouts/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f28c133

Please sign in to comment.