Skip to content

Commit c564eff

Browse files
committed
fix: fixes APIC-291 - navigation animation when bootstraping
1 parent 6444432 commit c564eff

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/ApiConsole.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,15 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
5454
background-color: #fff;
5555
transform: translateX(-100%);
5656
transform-origin: top right;
57-
transition: transform 0.3s cubic-bezier(0.74, 0.03, 0.3, 0.97);
5857
height: 100%;
5958
position: absolute;
6059
z-index: 5;
6160
}
6261
62+
.nav-drawer.animatable {
63+
transition: transform 0.3s cubic-bezier(0.74, 0.03, 0.3, 0.97);
64+
}
65+
6366
:host([navigationopened]) .nav-drawer {
6467
transform: translateX(0);
6568
box-shadow: var(--anypoiont-dropdown-shaddow);
@@ -584,6 +587,19 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
584587

585588
firstUpdated() {
586589
this._initExtensionBanner();
590+
this._setupNav();
591+
}
592+
/**
593+
* On Firefix the navigation hidding animation runs when the app is first rendered,
594+
* even if the navigation wasn't initially rendered. This to be called
595+
* after initial render has been made (DOM is constructed) to add the `animatable`
596+
* class on the navigation to enable animation effects.
597+
*/
598+
_setupNav() {
599+
setTimeout(() => {
600+
const nav = this.shadowRoot.querySelector('.nav-drawer');
601+
nav.classList.add('animatable');
602+
});
587603
}
588604

589605
__amfChanged() {

0 commit comments

Comments
 (0)