fix(ui-toolkit): delay parallax header hiding

This commit is contained in:
Fábio Moreira 2018-05-17 15:48:27 +01:00
parent c1ed981909
commit 1424254290
1 changed files with 3 additions and 3 deletions

View File

@ -92,8 +92,8 @@ export default class extends Component {
skipParallax = () => {
if (
this.state.show &&
window.scrollY < document.getElementsByTagName('header')[0].offsetTop
window.scrollY < document.getElementsByTagName('header')[0].offsetTop &&
this.state.show
) {
window.scroll({
top: document.getElementsByTagName('header')[0].offsetTop,
@ -106,7 +106,7 @@ export default class extends Component {
checkpoint = () => {
if (isScrolledOutsideView()) {
window.removeEventListener('scroll', this.checkpoint);
this.setState({ show: false });
setTimeout(() => this.setState({ show: false }), 10);
}
};