-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix ShellItems and MenuItems not displaying on Android when Flyout is presented, for both custom and default templates #30512
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
base: main
Are you sure you want to change the base?
Conversation
Hey there @@SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this 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 ensures that ShellItem
and MenuItem
entries render correctly on Android when FlyoutIsPresented
is set, by updating the renderer logic and adding end-to-end tests and a HostApp sample.
- Updated Android
ShellFlyoutTemplatedContentRenderer
to reload flyout content whenFlyoutIsPresented
is true. - Added a HostApp sample (
Issue21963
) that presents the flyout with both item and menu templates applied. - Introduced a shared UI test (
Issue21963
) verifying all shell content and menu items appear initially.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21963.cs | New UI test asserting presence of shell content and menu items. |
src/Controls/tests/TestCases.HostApp/Issues/Issue21963.cs | HostApp test page setting FlyoutIsPresented , templates, and items. |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs | Renderer change to call UpdateFlyoutContent when flyout is already open. |
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21963.cs:1
- [nitpick] The preprocessor macro name is confusing and singular; consider renaming to
TESTS_FAIL_ON_WINDOWS
or using an NUnit[Platform]
or[Category]
attribute to exclude Windows-specific tests.
#if TEST_FAILS_ON_WINDOWS// This test fails on Windows: Shell.MenuItemTemplate behaves correctly,AutomationId does not work as expected on the Windows platform.
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs:442
- Since the renderer now reacts to
FlyoutIsPresented
, please update the corresponding XML docs in/docs/
to describe this new behavior.
if ((_initialLayoutChangeFired || FlyoutView.FlyoutBehavior == FlyoutBehavior.Locked || _shellContext.Shell.FlyoutIsPresented) &&
…963.cs Co-authored-by: Copilot <[email protected]>
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!
Issue Description
Shell.MenuItem
andShellItem
do not render correctly on Android when FlyoutIsPresented is set to true, affecting both templated and non-templated scenarios.Root Cause
The
FlyoutContent
was not created in time because the flyout was already presented before the associated template or view had a chance to load.Description of Change
Added logic in
OnFlyoutViewLayoutChanging
to ensure that the flyout content is properly initialised and reloaded when necessary, even if the flyout is already visible. This ensures that both templated and non-templated views render as expected.Issues Fixed
Fixes #21963
Tested the behaviour in the following platforms
Output Screenshot