Skip to content

Commit

Permalink
create directive to disable scroll reset - 1st attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
rrchai committed Oct 2, 2023
1 parent 31b4941 commit 219fcdc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/openchallenges/app/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const appConfig: ApplicationConfig = {
routes,
withEnabledBlockingInitialNavigation(),
withInMemoryScrolling({
// scrollPositionRestoration: 'top',
scrollPositionRestoration: 'top',
})
),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<main class="base mat-typography">
<main sageDisableScrollPositionRestoration class="base mat-typography">
<section id="search-top">
<div id="title" class="row">
<div class="col col-10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ import { DropdownModule } from 'primeng/dropdown';
import { InputTextModule } from 'primeng/inputtext';
import { PanelModule } from 'primeng/panel';
import { RadioButtonModule } from 'primeng/radiobutton';
import { SeoService } from '@sagebionetworks/shared/util';
import {
DisableScrollPositionRestorationDirective,
SeoService,
} from '@sagebionetworks/shared/util';
import { getSeoData } from './challenge-search-seo-data';

@Component({
Expand All @@ -109,6 +112,7 @@ import { getSeoData } from './challenge-search-seo-data';
ChallengeCardComponent,
CheckboxFilterComponent,
SearchDropdownFilterComponent,
DisableScrollPositionRestorationDirective,
],
templateUrl: './challenge-search.component.html',
styleUrls: ['./challenge-search.component.scss'],
Expand Down
1 change: 1 addition & 0 deletions libs/shared/typescript/util/src/lib/directives/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './app-shell-no-render.directive';
export * from './app-shell-render.directive';
export * from './disable-scroll-position-restoration.directive';

0 comments on commit 219fcdc

Please sign in to comment.