Skip to content

Commit

Permalink
fix: #1665 prod release fixes (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigyu authored Nov 20, 2024
1 parent b09de70 commit 98ae7ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions frontend/src/assets/styles/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ label {
width: 100vw;
bottom: 0;
padding: 1.06rem 1rem 0 1rem;
overflow-y: auto;
}

.page-body {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/layouts/ProtectedLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ watch(termsAndConditionQuery.status, () => {
</script>

<template>
<div id="proctected-layout-container">
<div id="protected-layout-container">
<!-- Show layout and content -->
<TermsAndConditions />
<Header title="FAM" subtitle="Forests Access Management" />
Expand All @@ -80,7 +80,7 @@ watch(termsAndConditionQuery.status, () => {
</div>
</template>
<style lang="scss">
#proctected-layout-container {
#protected-layout-container {
.terms-and-condition-spinner-container {
.spinner-container {
display: flex;
Expand Down
17 changes: 9 additions & 8 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ export const router = createRouter({
}
}),
scrollBehavior(to) {
// Check if the route has the `protectedLayoutMeta`
if (to.meta?.layout === "ProtectedLayout") {
return {
top: 0,
behavior: "smooth",
el: "#proctected-layout-container",
};
const mainElement = document.querySelector(".main");
if (mainElement) {
mainElement.scrollTo({
top: 0,
behavior: "smooth",
});
}
return false; // Prevent default Vue Router scrolling behavior
}
// Default behavior (no scrolling for other routes)
return false;
return false; // Default behavior for other routes
},
});

0 comments on commit 98ae7ff

Please sign in to comment.