mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 13:52:50 +00:00
Accordion - restore scrollRestoration to "auto" after scroll
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user