Skip to content

[Mac] Fix FlowDirection Property for DatePicker Not Functioning#2

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-1
Draft

[Mac] Fix FlowDirection Property for DatePicker Not Functioning#2
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-1

Conversation

Copilot AI commented Jun 24, 2025

Copy link
Copy Markdown

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Fixes the FlowDirection property for DatePicker on macOS platform. Previously, when FlowDirection was set to RightToLeft, the control would not update and would continue to display as LeftToRight.

Problem

The MacOS DatePickerRenderer was missing FlowDirection property change handling that exists in Windows and iOS implementations. This caused the DatePicker to ignore FlowDirection changes on macOS.

Root Cause

  • MacOS DatePickerRenderer doesn't listen for VisualElement.FlowDirectionProperty.PropertyName changes
  • Missing UpdateFlowDirection method
  • No initial FlowDirection setup in OnElementChanged

Solution

Added the missing FlowDirection support following the same pattern as Windows and iOS platforms:

  1. Property change handler: Listen for VisualElement.FlowDirectionProperty.PropertyName changes in OnElementPropertyChanged
  2. UpdateFlowDirection method: Uses existing NSView.UpdateFlowDirection extension method
  3. Initial setup: Call UpdateFlowDirection() in OnElementChanged to set initial flow direction

Changes Made

// In OnElementChanged - added initial FlowDirection setup
UpdateFlowDirection();

// In OnElementPropertyChanged - added FlowDirection property listener  
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
    UpdateFlowDirection();

// Added new UpdateFlowDirection method
void UpdateFlowDirection()
{
    Control?.UpdateFlowDirection(Element as IVisualElementController);
}

Testing

The implementation follows the exact same pattern as working Windows and iOS DatePickerRenderers and leverages the existing UpdateFlowDirection extension method for NSView which properly sets UserInterfaceLayoutDirection for RTL/LTR behavior.

Fixes #1.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 11vvsblobprodcus336.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 37bvsblobprodcus311.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 4vyvsblobprodcus361.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 4zjvsblobprodcus390.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 51yvsblobprodcus36.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 5rqvsblobprodcus385.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 6s7vsblobprodcus313.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • 7k6vsblobprodcus337.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • 80zvsblobprodcus35.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • ajhvsblobprodcus363.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • ckzvsblobprodcus347.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • d0svsblobprodcus381.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • dlbvsblobprodcus316.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • e7bvsblobprodcus348.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • gervsblobprodcus329.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • jd4vsblobprodcus366.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • jrqvsblobprodcus343.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • kijvsblobprodcus387.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • kxqvsblobprodcus376.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • ljcvsblobprodcus317.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • m16vsblobprodcus374.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • m6xvsblobprodcus342.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • o3svsblobprodcus318.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • p2ovsblobprodcus312.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • rcxvsblobprodcus328.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • sc4vsblobprodcus331.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • tphvsblobprodcus375.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • u6ovsblobprodcus377.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • ukkvsblobprodcus352.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • yttvsblobprodcus357.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)
  • ytvvsblobprodcus310.vsblob.vsassets.io
    • Triggering command: dotnet build Microsoft.Maui-mac.slnf --verbosity minimal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 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.

Co-authored-by: PaulAndersonS <42271912+PaulAndersonS@users.noreply.github.com>
Copilot AI changed the title [WIP] [Mac] FlowDirection Property of DatePicker Is Not Functioning as Expected [Mac] Fix FlowDirection Property for DatePicker Not Functioning Jun 24, 2025
Copilot AI requested a review from PaulAndersonS June 24, 2025 17:07
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.

[Mac] FlowDirection Property of DatePicker Is Not Functioning as Expected

2 participants