Merge pull request #5002 from betagouv/js-fix-scroll-exceptions

Usager : corrige une erreur Javascript au moment du Feedback, liée à l'utilisation de `window.scroll`
This commit is contained in:
Pierre de La Morinerie 2020-04-06 18:32:11 +02:00 committed by GitHub
commit 97dc927289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,7 @@
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
try {
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
} catch {
window.scroll(0, 0);
}
<%= remove_element('#user-satisfaction') %>
<%= render_flash %>