🐛 fix bug critique sur firefox < 58 qui causait une page blanche

pull/411/head
Johan Girod 2018-10-17 12:15:58 +02:00
parent d6b4098d4e
commit 3ac18b04c8
1 changed files with 11 additions and 5 deletions

View File

@ -52,11 +52,17 @@ export class ScrollToElement extends Component {
) {
return
}
this.ref.scrollIntoView({
behavior: this.props.behavior,
block: 'nearest',
inline: 'nearest'
})
try {
this.ref.scrollIntoView({
behavior: this.props.behavior,
block: 'nearest',
inline: 'nearest'
})
} catch (error) {
this.ref.scrollIntoView({
behavior: this.props.behavior
})
}
}
componentDidMount() {
this.scrollIfNeeded()