Skip to content

Fix Shell RTL layout and content propagation on iOS/MacCatalyst#28

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/fix-issue-32419
Draft

Fix Shell RTL layout and content propagation on iOS/MacCatalyst#28
Copilot wants to merge 7 commits intomainfrom
copilot/fix-issue-32419

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 17, 2025

Fixes dotnet#32419

Shell with FlowDirection="RightToLeft" on iOS/MacCatalyst had two issues:

  1. With FlyoutBehavior="Locked", flyout and content positioning ignored RTL (both appeared in LTR layout)
  2. Content pages inside Shell remained LTR regardless of Shell's FlowDirection

Changes

SlideFlyoutTransition.cs - Fixed flyout/content positioning for RTL

Refactored LayoutViews() to check SemanticContentAttribute and position views accordingly:

bool isRtl = shell.SemanticContentAttribute == UISemanticContentAttribute.ForceRightToLeft;

if (behavior == FlyoutBehavior.Locked)
{
    if (isRtl)
    {
        // RTL: flyout right, content left
        shell.Frame = new CGRect(bounds.X, bounds.Y, bounds.Width - flyoutWidth, flyoutHeight);
        flyout.Frame = new CGRect(bounds.Width - flyoutWidth, 0, flyoutWidth, flyoutHeight);
    }
    else
    {
        // LTR: flyout left, content right (original behavior)
        shell.Frame = new CGRect(bounds.X + flyoutWidth, bounds.Y, bounds.Width - flyoutWidth, flyoutHeight);
        flyout.Frame = new CGRect(0, 0, flyoutWidth, flyoutHeight);
    }
}

ShellSectionRootRenderer.cs - Propagate RTL to content pages

Enhanced UpdateFlowDirection() to update current content page's platform view:

void UpdateFlowDirection()
{
    if (_shellContext?.Shell?.CurrentItem?.CurrentItem == ShellSection)
    {
        this.View.UpdateFlowDirection(_shellContext.Shell);
        
        // Propagate to content page
        if (_currentContent != null)
        {
            var page = ((IShellContentController)_currentContent).GetOrCreateContent();
            if (page?.Handler?.PlatformView is UIView pageView)
            {
                pageView.UpdateFlowDirection(page);
            }
        }
    }
}

Also added UpdateFlowDirection() call when current content changes to ensure new pages inherit correct direction.

Tests

Added UI tests (Issue32419.xaml, Issue32419Page.xaml, Issue32419.cs) validating:

  • Locked flyout positions correctly in RTL (flyout right, content left)
  • Content page elements align right in RTL mode
  • Screenshot verification for visual correctness

Platforms

  • iOS ✓
  • MacCatalyst ✓ (shares iOS implementation)
Original prompt

fix dotnet#32419

Custom agent used: issue-resolver
Specialized agent for investigating and resolving community-reported .NET MAUI issues through hands-on testing and implementation


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 18, 2025 00:04
Co-authored-by: kubaflo <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: kubaflo <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: kubaflo <42434498+kubaflo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with Maui framework functionality Fix Shell RTL layout and content propagation on iOS/MacCatalyst Nov 18, 2025
Copilot AI requested a review from kubaflo November 18, 2025 00:13
@kubaflo kubaflo force-pushed the main branch 4 times, most recently from 790e973 to 971e326 Compare November 22, 2025 14:01
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.

[iOS, Mac Catalyst] Shell Flyout and Content Do Not Fully Support RightToLeft (RTL)

2 participants