Open lauchacarro opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
@lauchacarro thank you for the workaround! I too have this issue and your workaround did the trick. Hopefully this gets fixed in an expedited manner.
Hi, @lauchacarro It may be the same issue as Issue #8226. If it is the same case, you can avoid it with the following code. I was also in trouble with the same Issue.
Shell.Current.FlyoutBehavior = FlyoutBehavior.Locked;
Shell.Current.FlyoutBehavior = FlyoutBehavior.Flyout;
Shell.Current.FlyoutIsPresented = true;
Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. This issue does not repro on Windows 11 and iOS 16.4, repro on Android 13.0-API33 with below Project: 13233.zip
My small and shorter modification of the workaround in #8226
bool alreadyOpen = false;
#if ANDROID
if (!alreadyOpen)
{
Shell.Current.FlyoutBehavior = FlyoutBehavior.Flyout;
alreadyOpen = true;
Shell.Current.FlyoutBehavior = FlyoutBehavior.Disabled;
}
#endif
Shell.Current.FlyoutIsPresented = !Shell.Current.FlyoutIsPresented;
Description
When I want to open the Flyout menu programmatically by clicking on a button. It does not work.
You have to manually open the menu for the first time and then it just works programmatically.
Steps to Reproduce
Clone https://github.com/lauchacarro/Maui-FlyoutMenu-Programmatically
Run Androd Project
First click twice on button 1 and you will see that nothing happens.
Now click once on button 2 and you will see the flyout menu open.
If you see the code in MainPage.xaml.cs, you will know why one button works and another does not.
Practically, there must be a UI interaction before using FlyoutIsPresented.
Link to public reproduction project repository
https://github.com/lauchacarro/Maui-FlyoutMenu-Programmatically
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
Android
Affected platform versions
Android 21
Did you find any workaround?
Add an invisible label in MainPage.xaml
Then, in the button click event, edit the label text before using the FlyoutIsPresented property.
Relevant log output
No response