Issues with adding menu panels

Since the addition of the Full Height Swipable Menus, getting a custom menu panel to work properly has become a bit tricky, particularly on mobile.

The addHeaderPanel api method still adds the menu in the correct place in the DOM, which is great, however there are a few other elements you need to add to get the panel working correctly:

  1. Custom mobile cleanup code in the panel widget when the panel closes on mobile, see e.g. Full height swipe-able menus (#6566) · discourse/discourse@71d8807 · GitHub. Ideally this would be abstracted out of each individual menu (including the core ones) into the header widget.

  2. I’m not sure exactly why, but if the additionalPanels are added to the header html after the header-cloak, the header-cloak retains the custom style attributes added to animate the cloak’s removal in the closing process. If the additionalPanels are added before the cloak, like the other menu panels, this issue does not occur. In any event, I’ve submitted a PR for this piece, i.e. adding the additionalPanels directly after the normal panels and before the cloak.

3 Likes

Hm, that sounds like an oversight on my part when implementing, pardon the dust

6 Likes