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] FlyoutPage ShouldShowToolbarButton when overridden to return false, still shows button in title bar #24547

Open
bmacombe opened this issue Aug 30, 2024 · 5 comments · May be fixed by #25857
Assignees
Labels
area-controls-flyout Flyout area-navigation NavigationPage partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@bmacombe
Copy link
Contributor

bmacombe commented Aug 30, 2024

Description

Using the Popover behavior

On Android it removes the hamburger icon and on iOS removes the menu text when you override ShouldShowToolbarButton on a FlyoutPage to return false.

But on Windows the hamburger icon is still present in the title bar.

image

My use case is implementing my own TitleView to make navigation UI consistent across all platforms. The extra hamburger icon on Windows causes no issues being there but is not needed or wanted.

Related Android issue on this topic
#15111

Steps to Reproduce

Set the MainPage as a FlyoutPage
Override ShouldShowToolbarButton to return false
Start app and observe the hamburger button is still present

Link to public reproduction project repository

https://github.com/bmacombe/MauiFlyoutTitleBar

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@bmacombe bmacombe added the t/bug Something isn't working label Aug 30, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@Zhanglirong-Winnie Zhanglirong-Winnie added platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Sep 2, 2024
@Zhanglirong-Winnie
Copy link

This issue has been verified using Visual Studio 17.12.0 Preview 1.0(8.0.82 & 8.0.80 & 8.0.72). Can repro on Windows platform.

@jsuarezruiz jsuarezruiz added this to the Backlog milestone Oct 15, 2024
@bmacombe
Copy link
Contributor Author

bmacombe commented Oct 25, 2024

Until this is fixed in Maui this can be fixed with a Handler Maping.

#if WINDOWS
		Microsoft.Maui.Handlers.FlyoutViewHandler.Mapper.AppendToMapping(nameof(IFlyoutView.FlyoutBehavior),
			(handler, view) =>
			{
				handler.PlatformView.IsPaneToggleButtonVisible = show;
			});
#endif

@bmacombe
Copy link
Contributor Author

This line of code needs to respect the value returned from ShouldShowToolbarButton. But I'm not familiar enough with Maui codebase at the moment to do a PR to route that value into the method.

IsPaneToggleButtonVisible = true;

@bmacombe
Copy link
Contributor Author

Slightly revised mapping

#if WINDOWS
		Microsoft.Maui.Handlers.FlyoutViewHandler.Mapper.AppendToMapping(nameof(IFlyoutView.FlyoutBehavior),
			(handler, view) =>
			{
				if (view is FlyoutPage page)
					handler.PlatformView.IsPaneToggleButtonVisible = page.ShouldShowToolbarButton();
			});
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-flyout Flyout area-navigation NavigationPage partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
5 participants