SPFx Application Customizer: hide search box

Microsoft

I have a requirement to hide Search box on home page of a SPO site. It is a modern page so need to hide the search box using application customizer.

Preeti1910_0-1649399592618.png

 

 

I tried with both options. Added code on init() and _renderPlaceHolders().

 

Code used:

 

let elementToEdit: any;
elementToEdit = document.getElementById('sbcId');
elementToEdit.style.display ="none";

 

While debugging , I can see it hides the search box but on coming out of debug mode , search box appears again.

 

Please suggest the way to achieve this.

0 Replies