Skip to content

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

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

Conversation

SuthiYuvaraj
Copy link
Contributor

@SuthiYuvaraj SuthiYuvaraj commented Jul 9, 2025

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 and ShellItem 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

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before Issue Fix After Issue Fix
Before Fix After Fix

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

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.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 9, 2025
@jsuarezruiz jsuarezruiz added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Jul 10, 2025
@SuthiYuvaraj SuthiYuvaraj changed the title Fix Shell.MenuItemTemplate doesnot render when FlyoutIsPresented is set to true in Android Platform Fix ShellItems and MenuItems not displaying on Android when Flyout is presented, for both custom and default templates Jul 10, 2025
@SuthiYuvaraj SuthiYuvaraj marked this pull request as ready for review July 10, 2025 09:54
@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 09:54
@SuthiYuvaraj SuthiYuvaraj requested a review from a team as a code owner July 10, 2025 09:54
Copy link
Contributor

@Copilot 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 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 when FlyoutIsPresented 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) &&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell.MenuItemTemplate Sometime Does Not Work
2 participants