Skip to content

Commit

Permalink
Fixed Scroll top issue between page navigation
Browse files Browse the repository at this point in the history
After scrolling down a page and navigating from that page to
other pages, the page still shows the bottom of the page and does not
display the top of the page.

Scroll behavior added in the router, So when navigating from one page
to another page the top of the page will always display.

Change-Id: I883e8a9f6ae3f98846996883cac0961b4c24c62b
Signed-off-by: aravinths1 <aravinths@ami.com>
  • Loading branch information
aravinths1 authored and kirankumarb07 committed May 24, 2024
1 parent 1ccd887 commit b325541
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const router = new VueRouter({
base: process.env.BASE_URL,
routes,
linkExactActiveClass: 'nav-link--current',
scrollBehavior() {
return { x: 0, y: 0 };
},
});

function allowRouterToNavigate(to, next, currentUserRole) {
Expand Down

0 comments on commit b325541

Please sign in to comment.