fix: ref transitions for firefox

This commit is contained in:
SrGooglo 2023-10-10 12:10:01 +00:00
parent 8be2a0279d
commit 04a72c80b2

View File

@ -124,7 +124,6 @@ export class PagePanelWithNavMenu extends React.Component {
return React.createElement(tab.component, {
...componentProps,
ref: this.primaryPanelRef,
})
}
@ -160,6 +159,7 @@ export class PagePanelWithNavMenu extends React.Component {
console.warn("PagePanelWithNavMenu: transition is enabled but document.startViewTransition is not compatible with your browser")
if (this.primaryPanelRef.current && this.primaryPanelRef.current?.classList) {
// set to primary panel fade-opacity-leave class
this.primaryPanelRef.current.classList.add("fade-opacity-leave")
@ -167,6 +167,7 @@ export class PagePanelWithNavMenu extends React.Component {
setTimeout(() => {
this.primaryPanelRef.current.classList.remove("fade-opacity-leave")
}, 300)
}
await new Promise(resolve => setTimeout(resolve, 200))
}
@ -226,7 +227,7 @@ export class PagePanelWithNavMenu extends React.Component {
}
<div className="pagePanels">
<div className="panel">
<div className="panel" ref={this.primaryPanelRef}>
{
this.renderActiveTab()
}