Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i disable a body style for only one component

I want to disable overflow-y: hidden style for only one component. This style is in my style.scss like so

body {
overflow-y: hidden;
}

I tried this in my component but it did not work.

<div class="div1" style="overflow-y: visible !important;">
...
</div>
like image 867
mark Avatar asked Feb 03 '23 15:02

mark


1 Answers

Can you try to put

.visibleClass{overflow-y: visible ;}

to style.css under body css attribute

in appcomponent.html add activate event to router-outlet

<router-outlet (activate)="showHideNav($event)"></router-outlet>

then in component.ts

 showHideNav(event){
    event instanceof YourComponent ? document.body.classList.add("visibleClass") :
                                     document.body.classList.remove("visibleClass")
  } 
like image 69
mr. pc_coder Avatar answered Feb 06 '23 16:02

mr. pc_coder