Turning off Shy Menu in SharePoint modern

Copper Contributor

Hi,

 

I currently have a site set up and I'm using the hub feature to keep a consistant menu across the site. One of our users asked me why the menu keeps disappearing and I noticed that when you scroll down the page, the menu colapses (apparently to give the user more of a reading view style).

 

After some research, I found out about the shy menu feature being added to modern sites and wondered if there was a way to turn this off. The space saved vs losing the menu entirely when scrolling is not worth it at all for the users of the site and they are becoming frustrated that they have to scroll to the top of the page to see the menu again.

 

I've looked through the options in the change the look section and can't find any settings to change this behaviour. Any help would be much appreciated.

 

Thanks,

 

Tom

5 Replies

@tomcowling 

 

It looks to me that at the moment there is no means to control this feature.  It appeared on my site pages and thus far an exploration of Site Settings and some Googling has not yielded any results.  I'm sure this will be much requested however.

Ahh. That's disappointing.
The shy header can cause some real issues especially if you've customised the top nav of your site collections. MS should really provide the ability to disable this functionality. I don't really understand the use case for such a development. It's not exactly common practice on the web and saves minimal screen space whilst creating quite a jarring user experience.
it's Nov. 16, 2021. we are still seeing this. is MS letting us turn off this feature? on our hub, we have an extensive navigation system built into the menus to reflect our business. on news pages containing "What's New" content, we insert screenshots of the hub's menu, highlighting the right path to new production items in the menu. but when users scroll down the page, the menu disappears and they can't reference the menu anymore. defeats the purpose of putting screenshots of the menu on the page. definitely need a site setting to turn off shy menus.

@tomcowling 

 

 


Avail, here is ur 2024 code... to disable the header, and the flickering.

 

<script>
// disable flickering after hiding the header & shy header
window['__shyConductor']._totalHeightDifference = 0;
</script>

<style>
#spSiteHeader /* disable shy & page header bar */ {
display: none !important;
}

/* optional cleanup */
#sp-appBar, /* disable left nav bar */
#spCommandBar, /* disable command bar */
[data-automation-id=pageHeader] /* disable title bar */
{
display: none !important;
}
</style>

 

The _shyConductor is object that contains all functions for the shy header inside Microsoft Sharepoint Page. By setting heightDifference to 0, we are just quickly ignoring any change to update the scrollTop. You could use any other function of shyHeader instance to disable that as well, but I found this the simplest trick in the book.

 

Helped? Follow me on https://github.com/elkolorado