question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ControlCatalog: Side-menu toggling breaks after a page is opened

See original GitHub issue

Describe the bug

In the ControlCatalog, if you open the previously collapsed side-menu and select an menu item, you cannot re-open the collapsed side-menu again.

To Reproduce

Steps to reproduce the behavior:

  1. Open ControlCatalog (Windows, Android,…)
  2. Reduce the width of the Window until the left side-menu collapses/hides (important!)
  3. Click the Hamburger button multiple times - the side-menu shows and hides as expected
  4. Now, open a menu item like “Calendar”
  5. Try to open the side-menu again
  6. The side-menu does not open anymore - you have to restart the app to select another page

Expected behavior

The side-menu should always open/close.

Desktop (please complete the following information):

  • OS: Windows 11 22H2 (22621.1344)
  • Version:
    • Works on 11 Preview 5,
    • Broken on current Master branch (92562b0d9979becc8d8c2316e1c2f0678bdae19d)

Investigation

The SplitView’s IsPaneOpen is bound by the Hamburger button.

SplitView.CoerceIsPaneOpen should always get triggered when the Hamburger button (ToggleButton) gets clicked. When it works, it is called for true and false. As soon as its broken, it’s only called when the value is true.

Wild guess: As the side-menu already closes as soon as the menu-item is pressed (not released!), it seems as the mouse is captured in a weird way by the menu item or something.

Guilty Commit

80394d0097c4acc9b3b74024a863b97774c35d3e (but I think it’s an unhider as this changes IsPaneOpen from DirectProperty to StyledProperty)

Maybe some issue with StyledProperty?

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
amwxcommented, Mar 14, 2023

In case it was the same as #10655, I had a look, and the issue here is: https://github.com/AvaloniaUI/Avalonia/blob/cbe0bb861a767b7bf7b268bbaa1d89dcf8523aea/samples/SampleControls/HamburgerMenu/HamburgerMenu.cs#L56-L62

Selecting an item with the SplitView display mode in Overlay results in setting IsPaneOpen to false with Animation priority - which is never reset so the pane can never be reopened as the HamburgerMenuButton ToggleButton in the template is two-way bound to the SplitView

0reactions
robloocommented, Mar 17, 2023

@amwx Thanks for tracking that down!

The fix seems easy: use the brand-new SetCurrentValue() method that won’t destroy bindings and also won’t change binding priority or require setting as animation. Quick test seems to work OK, will open a PR to close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sidebar toggle effect is breaking my menu items
I'm creating a very simple sidenav for a mobile app. I followed this example. Everything is working fine, except that when I close...
Read more >
How to Create, Add, & Edit a WordPress Navigation Menu
On the Menus page, click the Manage with Live Preview button, or go to Appearance → Customize and click the Menus option. Either...
Read more >
4. Types of Navigation - Designing Web Navigation [Book]
The position of a navigation on a page. What's more, the type of page on which a navigational menu appears greatly determines the...
Read more >
How To Create a Collapsed Sidebar
Click on the button to open the collapsible sidebar: ... use this if you want to push the page content to the right...
Read more >
Source code navigation | IntelliJ IDEA Documentation
In the Settings dialog ( Ctrl Alt 0S ), go to Editor | General. In the Caret Movement section, use the When moving...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found