I need help on hiding scrollbar during transition .
    trigger("routeFadeState", [
  transition(":enter", [
    style({
      transform: "translateY(-100vh)"
    }),
    animate("1000ms ease-out")
  ]),
  transition(":leave",
    animate(
      "500ms",
      style({
        transform: "translateY(-100vh)",
        overflow: hidden
      })
    )
  )
]);
I'm trying to implement slideInfromTop on :enter and slideOutToTop on :leave . The screen which slideIn should occupy the full screen height and full screen width .
During :enter , my code works perfect . the screen smoothly slidesin with neither vertical scrollbar nor horizontal scrollbar . Scrollbars don't appear at all .
During :leave , though the screen slides out , I see scrollbars appear for a split-second . I want to get rid of that .
I don't use any css frameworks .
Please help me out

There are many items which lead to the scrollbars.
html, body {
  margin: 0;
  padding: 0;
}
position:absolute part to all component that will be loaded in the <router-outlet> so all component will be positioned absolutely so you don't have to go to each component and write position: absolute, display: block, width and height. Your styles for your global css for your routed component as followsrouter-outlet + * {
  position: absolute;
  display: block;
  height: 100vh;
  width: 100vw;
}
Home (CSS)                      |  About (CSS)
:host {                         |  :host { 
  background-color: yellow;     |    background-color: red;
}                               |  }
Updated Stackblitz: https://stackblitz.com/edit/angular-qdxphn
Now you have a much cleaner base and route animations will never trouble you again.
Cheers✌🏽
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With