Skip to content

fix: MenuFlyout sub-item tree direction and icon in RTL mode#1313

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-menuflyout-tree-path
Draft

fix: MenuFlyout sub-item tree direction and icon in RTL mode#1313
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-menuflyout-tree-path

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

MenuFlyoutSubItem always opened its sub-menu to the right and showed a chevron_right icon regardless of text directionality, producing broken UX in RTL layouts.

Changes

  • Direction-aware trailing icon — Replaced the static WindowsIcon(WindowsIcons.chevron_right) default trailing with a new private _MenuFlyoutSubItemChevron widget that reads Directionality at build time and renders chevron_left in RTL / chevron_right in LTR.

  • RTL-aware sub-menu positioning — Added textDirection field to _SubItemPositionDelegate. In RTL mode the sub-menu opens to the left of the parent item by default, falling back to the right only if it would overflow the left edge. LTR behavior is unchanged.

  • Directionality passed at show time_MenuFlyoutSubItemState.show() now passes Directionality.of(context) to _SubItemPositionDelegate.

Tests

  • LTR: chevron_right icon present, chevron_left absent
  • RTL: chevron_left icon present, chevron_right absent
  • RTL: sub-menu left edge is to the left of the parent item's left edge
Original prompt

This section details on the original issue you should resolve

<issue_title>🐛 MenuFlyout tree chooses the wrong path when right-to-left is enabled</issue_title>
<issue_description>Describe the bug
MenuFlyout sub item tree chooses the wrong path when directionality is right-to-left. The icon is also incorrect.

To Reproduce
Steps to reproduce the behavior:

  1. Create a MenuFlyout with sub items
  2. Hover to show the sub items

Expected behavior
It should go to the opposite expected route (left). The icon should change as well.

  • Left to right: the sub menus should construct to the right.
  • Right to left: the sub menus should construct to the right.

Screenshots
Image

Additional context
n/a
</issue_description>

<agent_instructions>Update the tests and the changelog at the end.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MenuFlyout incorrect path for right-to-left directionality fix: MenuFlyout sub-item tree direction and icon in RTL mode Mar 20, 2026
Copilot AI requested a review from bdlukaa March 20, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 MenuFlyout tree chooses the wrong path when right-to-left is enabled

2 participants