# Issues with adding menu panels

**URL:** https://meta.discourse.org/t/issues-with-adding-menu-panels/113499
**Category:** Development
**Created:** [April 5, 2019, 3:26am UTC](https://meta.discourse.org/t/issues-with-adding-menu-panels/113499 "2019-04-05T03:26:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 5, 2019, 3:26am UTC](https://meta.discourse.org/t/issues-with-adding-menu-panels/113499/1 "2019-04-05T03:26:10Z")

</div>

Since the addition of the [Full Height Swipable Menus](https://github.com/discourse/discourse/commit/71d8807fec20e9a4a766b9763ff0c9ba8980f62e#diff-a362332e13d860478ac77243b7279a77), 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](https://github.com/discourse/discourse/commit/71d8807fec20e9a4a766b9763ff0c9ba8980f62e#diff-a362332e13d860478ac77243b7279a77L327). 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.

[https://github.com/discourse/discourse/pull/7325](https://github.com/discourse/discourse/pull/7325)

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [April 5, 2019, 5:52am UTC](https://meta.discourse.org/t/issues-with-adding-menu-panels/113499/2 "2019-04-05T05:52:23Z")

</div>

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