diff --git a/CHANGELOG.md b/CHANGELOG.md index 2abae7b3..47a8309a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - feat: Add `TabView.stripBuilder` ([#1106](https://github.com/bdlukaa/fluent_ui/issues/1106)) - fix : The EditableComboBox is missing the part that applies the style to the TextBox, so add it. - feat: Add `BreadcrumbBar.chevronIconBuilder` and `BreadcrumbBar.chevronIconSize` ([#1111](https://github.com/bdlukaa/fluent_ui/issues/1111)) +* fix: Consider object translation on Menu Flyouts ([#1104](https://github.com/bdlukaa/fluent_ui/issues/1104)) ## 4.9.1 diff --git a/lib/src/controls/flyouts/menu.dart b/lib/src/controls/flyouts/menu.dart index 20dd1263..92f283ae 100644 --- a/lib/src/controls/flyouts/menu.dart +++ b/lib/src/controls/flyouts/menu.dart @@ -140,11 +140,14 @@ class _MenuFlyoutState extends State { final itemBox = subItem.currentContext!.findRenderObject() as RenderBox; - final itemRect = itemBox.localToGlobal( - Offset.zero, - ancestor: parent?.widget.root?.context.findRenderObject(), - ) & - itemBox.size; + final parentBox = + (parent?.widget.root?.context.findRenderObject() as RenderBox); + final translation = parentBox.getTransformTo(null).getTranslation(); + final offset = Offset(translation[0], translation[1]); + final itemRect = + (itemBox.localToGlobal(Offset.zero, ancestor: parentBox) + + offset) & + itemBox.size; if (!itemRect.contains(event.position)) { state.close(menuInfo);