Skip to content

Conversation

@Ahamed-Ali
Copy link
Contributor

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!

Root Cause of the issue

  • The pos and old_pos values were being modified before positioning the children, causing the children to be positioned using incorrect reference points.

Description of Change

  • By moving the layout.reverse2 block after the child positioning, the children are now positioned using the correct pos and old_pos values.

Issues Fixed

Fixes #31565

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
FlexLayoutissue.mov
FlexLayoutFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 22, 2025
@dotnet-policy-service
Copy link
Contributor

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

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 22, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz added the layout-flex FlexLayout issues label Oct 22, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Pending snapshots on Mac:
image
Already available in the latest build. Could you commit the images?

@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review October 22, 2025 13:29
Copilot AI review requested due to automatic review settings October 22, 2025 13:29
Copy link
Contributor

Copilot AI left a comment

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 a FlexLayout positioning bug where children were incorrectly positioned when using Wrap = Reverse combined with AlignContent set to SpaceAround, SpaceBetween, or SpaceEvenly. The fix reorders the reverse layout calculations to occur after child positioning rather than before.

Key Changes:

  • Moved the layout.reverse2 block in Flex.cs to execute after child positioning instead of before
  • Added comprehensive UI tests covering all three affected AlignContent values

Reviewed Changes

Copilot reviewed 3 out of 15 changed files in this pull request and generated no comments.

File Description
src/Core/src/Layouts/Flex.cs Moved reverse layout calculation block after child positioning to use correct reference points
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31565.cs Added NUnit tests for SpaceAround, SpaceBetween, and SpaceEvenly scenarios
src/Controls/tests/TestCases.HostApp/Issues/Issue31565.cs Added interactive test page demonstrating the FlexLayout reverse alignment fix

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution layout-flex FlexLayout issues partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlexLayout alignment issue when Wrap is set to Reverse and AlignContent is set to SpaceAround, SpaceBetween or SpaceEvenly

2 participants