Skip to content

Commit

Permalink
fix faq button
Browse files Browse the repository at this point in the history
  • Loading branch information
toBeOfUse committed Feb 13, 2024
1 parent 37269f2 commit e0d461e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion public-frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ export const routerConfig = {
],
scrollBehavior(to, from, savedPosition) {
if (to.hash) {
// hack to scroll to an element, waiting for a potential page transition
// first. normally vue router scrolls to elements that you return in
// { el: ... } but our scroll container is the <body> and not the <html>
// element, which confuses it
setTimeout(
() => document
.querySelector(to.hash)
.scrollIntoView({behavior: "smooth"}),
200
);
return {
el: to.hash,
behavior: "smooth",
Expand All @@ -59,7 +69,7 @@ export const routerConfig = {
return {
top: 0,
behavior: "smooth",
el: "#app", // 😬
el: "#app", // bad to hardcode this. but, it doesn't work anyway (see above)
};
}
},
Expand Down

0 comments on commit e0d461e

Please sign in to comment.