Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Fixed Margin Not Applied to Shell Flyout Template Items on First Display #27060

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

prakashKannanSf3972
Copy link
Contributor

Root Cause

The ActualWidth value is checked before it is updated, as it only reflects the correct value after the ArrangeOverride method completes. This premature check returns zero, preventing proper arrangement of the item view, as necessary values are not passed during the initial layout phase.

Description of Change

The ArrangeOverride method was updated to execute arrangement logic only when finalSize has valid dimensions. This prevents layout issues caused by invalid sizes and ensures proper arrangement of the view. If these conditions are not met, the base implementation is used as a fallback.

Issues Fixed

Fixes #18423

Tested the behaviour in the following platforms

  • Android
  •   Windows
  •   iOS
  • Mac

Output

Before After
Before-Fix.mp4
After-Fix.mp4

Copy link
Contributor

Hey there @prakashKannanSf3972! 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 community ✨ Community Contribution label Jan 10, 2025
@prakashKannanSf3972
Copy link
Contributor Author

@dotnet-policy-service agree company="Syncfusion, Inc."

@prakashKannanSf3972 prakashKannanSf3972 marked this pull request as ready for review January 10, 2025 14:05
@prakashKannanSf3972 prakashKannanSf3972 requested a review from a team as a code owner January 10, 2025 14:05
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 10, 2025
@rmarinho
Copy link
Member

/rebase

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.Shell)]
public void VerifyTemplateViewMarginOnInitialDisplay()
Copy link
Contributor

Choose a reason for hiding this comment

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

The test is failing on Windows:

System.TimeoutException : Timed out waiting for element...

   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2163
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2180
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 665
   at Microsoft.Maui.TestCases.Tests.Issues.Issue18423.VerifyTemplateViewMarginOnInitialDisplay() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18423.cs:line 19
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test is failing on Windows:

System.TimeoutException : Timed out waiting for element...

   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2163
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2180
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 665
   at Microsoft.Maui.TestCases.Tests.Issues.Issue18423.VerifyTemplateViewMarginOnInitialDisplay() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18423.cs:line 19
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@jsuarezruiz , Thank you for pointing this out. Addressed the issue by updating the test logic and believe it will not fail in the next CI run.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks. The Windows snapshot is pending, could you commit it? Available in the latest build.

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.Shell)]
public void VerifyTemplateViewMarginOnInitialDisplay()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks. The Windows snapshot is pending, could you commit it? Available in the latest build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Windows] Shell flyout template items do not have a margin applied on first show
4 participants