Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Fix hidden modal with JavaScript disabled
Browse files Browse the repository at this point in the history
'appear' animation is preserved with client-side routing.
However, if JavaScript is enabled and the page is rendered on the server-side,
the 'appear' phase may not work as expected because the modal is already
rendered and displayed.
The flick is smoother on more performant hardware and network
  • Loading branch information
artkravchenko committed Sep 7, 2017
1 parent 11169e2 commit 83cfaf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/sidebar-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class SidebarModalOverlay extends React.Component {
constructor(props, ...args) {
super(props, ...args);
this.state = {
isAppearing: false,
isVisible: false
isAppearing: typeof window === 'undefined',
isVisible: typeof window === 'undefined'
};
}

Expand Down

0 comments on commit 83cfaf4

Please sign in to comment.