From 686a3e49e4f7a946b65684b6e62582146de875e8 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Mon, 26 Oct 2020 12:11:14 +0530 Subject: [PATCH] Accordion - restore scrollRestoration to "auto" after scroll --- components/Accordion.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/Accordion.jsx b/components/Accordion.jsx index 441381e..2a78543 100644 --- a/components/Accordion.jsx +++ b/components/Accordion.jsx @@ -28,6 +28,9 @@ const Accordion = ({ children, title = "More" }) => { // 4. and scroll into view and focus targetElement.focus(); targetElement.scrollIntoView({ behavior: "smooth", block: "center" }); + if ("scrollRestoration" in history) { + history.scrollRestoration = "auto"; + } } }