Skip to content

FlyoutPage does not respond to changes in the FlyoutLayoutBehavior property #18158

@mjo151

Description

@mjo151

Description

On iOS, changing the FlyoutLayoutBehavior property does not change the state of the Flyout menu page. For example, changing the FlyoutLayoutBehavior from Split to Popover should cause the flyout to change to Popover mode, but nothing happens. This works on Android, although there are other problems when changing FlyoutLayoutBehavior, and I will create a separate issue for that.

The PhoneFlyoutPageRenderer.HandlePropertyChanged handler does not handle changes to FlyoutLayoutBehavior. This should be a two line change to that method:

if (e.PropertyName == Microsoft.Maui.Controls.FlyoutPage.FlyoutLayoutBehaviorProperty.PropertyName) LayoutChildren(true);

Steps to Reproduce

  1. Create an app with a Flyout page on tablet/deskop (phone does not support Split mode)
  2. Toggle the FlyoutLayoutBehavior property between Split and Popover
  3. Notice that the flyout behavior of the flyout menu does not change

Link to public reproduction project repository

https://github.com/mjo151/maui-flyout-behavior-bug

Version with bug

8.0.0-rc.1

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

All iOS versions

Did you find any workaround?

The only workaround is to create a custom PhoneFlyoutPageRenderer that inherits from PhoneFlyoutPageRenderer and call LayoutChildren when the FlyoutLayoutBehavior changes. However, LayoutChildren is internal. I can call LayoutChildren using reflection but that's not a viable solution for a production app.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions