From c60b3812edae3dacf42b8c38da677511df9e8b68 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 17 Oct 2018 12:15:58 +0200 Subject: [PATCH] :bug: fix bug critique sur firefox < 58 qui causait une page blanche --- source/components/utils/Scroll.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source/components/utils/Scroll.js b/source/components/utils/Scroll.js index f0f234b16..07dcd7d6b 100644 --- a/source/components/utils/Scroll.js +++ b/source/components/utils/Scroll.js @@ -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()