Pre-allocating space for top app customizer hides the 'collapse content' button for library
Category
- [x] Bug
Describe the bug
App customizer in Top placeholder has a pre-allocated height of 40px. When a user clicks on the 'Expand content' option in a library's command bar, the 'Collapse content' option gets hidden behind the app customizer due to it's pre-allocated height.
Steps to reproduce
Create a top placeholder customiser (an empty div would do) with a pre-allocated height of 40px.
elements.xml/ClientSideInstance.xml should include: HostProperties="{"preAllocatedApplicationCustomizerTopHeight":"40"}">
Deploy the placeholder. Click 'Expand content' from a libary's command bar. Note the 'Collapse content' button is now hidden behind the app customizer.
Expected behavior
The 'Collapse content' button and associated div should be placed below the app customizer when the library is shown in 'expanded content' mode.
Developer environment
Additional context
Thanks for your contribution! Sharing is caring.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
To add to this, even if you don't set the preAllocatedApplicationCustomizerTopHeight setting, we are still seeing this issue.
I can reproduce following this to create a header placeholder app customizer: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/using-page-placeholder-with-extensions
In some tenancies it works as expected, in others it doesn't (see examples below):

Top example is how it is expected (and still works like this in some tenancies), however the majority of tenancies the application customizer is appearing above the expanded content (bottom example) and users are stuck, they can't minimize the content (even with a page refresh).
I've made a workaround solution for this. Not pretty but works, similar solution to @estruyf used for checking page navigation. Hopefully Microsoft can resolve so we don't have to add these hacks.
private checkForexpandCollapseList(){
const interval = window.setInterval(() => {
let collapsebuttons:any = document.querySelectorAll("[data-automationid='expandCollapseList']");
//if item exists on the page
if(collapsebuttons){
//hide menu
if(collapsebuttons[0].title == "Collapse content"){
const topbannermenu: HTMLElement = #${styles.myheader});
if(topbannermenu){
topbannermenu.style.display = "none";
}
// show menu
}else if (collapsebuttons[0].title == "Expand content"){
const topbannermenu: HTMLElement = #${styles.myheader});
if(topbannermenu){
topbannermenu.style.display = "block";
}
//show menu if another value
}else{
const topbannermenu: HTMLElement = #${styles.myheader});
if(topbannermenu){
topbannermenu.style.display = "block";
}
}
}
}, 200);
}
Any updates regarding this issue?
Sorry for the delay / missing metadata. This looks like it is fixed, although a separate issue (the customizer doesn't appear in focus mode) is being addressed separately.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues