Skip to content

Commit

Permalink
fix: navigate to main content whenever the user performs a page navig…
Browse files Browse the repository at this point in the history
…ation (#1839)
  • Loading branch information
mikaelrss authored Feb 19, 2024
1 parent 070d3b8 commit 7293d6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/wrappers/Presentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const PresentationComponent = (props: IPresentationProvidedProps) => {
<section
id='main-content'
className={classes.modal}
tabIndex={-1}
>
<Header {...props} />
<div className={classes.modalBody}>{props.children}</div>
Expand Down
1 change: 1 addition & 0 deletions src/features/layout/formLayoutSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const formLayoutSlice = () => {
takeEvery: (action) => {
if (!action.payload.focusComponentId) {
window.scrollTo({ top: 0 });
document.getElementById('main-content')?.focus({ preventScroll: true });
}
},
reducer: (state, action) => {
Expand Down

0 comments on commit 7293d6e

Please sign in to comment.