Skip to content

[iOS] RTL column mirroring in UICollectionView - fix#32372

Merged
PureWeen merged 3 commits into
dotnet:inflight/currentfrom
kubaflo:fix-32359
Nov 15, 2025
Merged

[iOS] RTL column mirroring in UICollectionView - fix#32372
PureWeen merged 3 commits into
dotnet:inflight/currentfrom
kubaflo:fix-32359

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 3, 2025

Copy link
Copy Markdown
Collaborator

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 of Change

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

Before After
Screen.Recording.2025-11-04.at.00.40.34.mov
Screen.Recording.2025-11-04.at.00.37.54.mov

Issues Fixed

Fixes #32359

Copilot AI review requested due to automatic review settings November 3, 2025 23:39
@kubaflo kubaflo self-assigned this Nov 3, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Nov 3, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@kubaflo

kubaflo commented Nov 3, 2025

Copy link
Copy Markdown
Collaborator Author

@copilot please write a UI test for this PR based on this issue #32359

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where iOS UICollectionView compositional layouts don't properly mirror columns in right-to-left (RTL) flow directions. The fix explicitly sets the SemanticContentAttribute on the native UICollectionView to ensure RTL layout behavior is correctly applied.

  • Adds explicit semantic content attribute handling for the UICollectionView based on FlowDirection
  • Maps FlowDirection enum values to appropriate UISemanticContentAttribute values
  • Only updates the SemanticContentAttribute when it differs from the desired value

Comment thread src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs Outdated
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could include an UITest to check that after switching to RTL: first column is right‑anchored?

}

if (CollectionView.SemanticContentAttribute != desiredAttr)
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compositional and flow layouts may not re-query attributes immediately, requires to force a layout pass?

@Ahamed-Ali Ahamed-Ali added area-controls-collectionview CollectionView, CarouselView, IndicatorView s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed i/regression This issue described a confirmed regression on a currently supported version collectionview-cv1 regressed-in-9.0.120 and removed area-controls-collectionview CollectionView, CarouselView, IndicatorView s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed collectionview-cv1 regressed-in-9.0.120 i/regression This issue described a confirmed regression on a currently supported version labels Nov 4, 2025
@PureWeen

PureWeen commented Nov 7, 2025

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 10.0 SR1.1 milestone Nov 12, 2025
@PureWeen PureWeen added the p/0 Current heighest priority issues that we are targeting for a release. label Nov 12, 2025
@PureWeen

Copy link
Copy Markdown
Member

/rebase

kubaflo and others added 3 commits November 13, 2025 17:40
Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.
@PureWeen

Copy link
Copy Markdown
Member

/backport to release/10.0.1xx-sr1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx-sr1 (link to workflow run)

@PureWeen

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
PureWeen changed the base branch from main to inflight/current November 15, 2025 15:22
@github-project-automation github-project-automation Bot moved this from Todo to Approved in MAUI SDK Ongoing Nov 15, 2025
@PureWeen
PureWeen merged commit ceff93f into dotnet:inflight/current Nov 15, 2025
155 of 163 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in MAUI SDK Ongoing Nov 15, 2025
github-actions Bot pushed a commit that referenced this pull request Nov 15, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
github-actions Bot pushed a commit that referenced this pull request Nov 20, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
github-actions Bot pushed a commit that referenced this pull request Nov 20, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
PureWeen added a commit that referenced this pull request Nov 21, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
github-actions Bot pushed a commit that referenced this pull request Nov 24, 2025
* Fix RTL column mirroring in UICollectionView

Explicitly sets the semantic content attribute on the native UICollectionView to ensure compositional layouts mirror columns correctly in right-to-left (RTL) scenarios. This addresses an issue where the platform view's semantic attribute does not propagate to native children not backed by IView.

* - add UITests

* Improvements

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

collectionview-cv2 community ✨ Community Contribution p/0 Current heighest priority issues that we are targeting for a release. platform/ios

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[iOS] FlowDirection="RightToLeft" issue in CollectionView version 9.0.120

5 participants