Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/fabric-website/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class App extends React.Component<IAppProps, any> {
window.removeEventListener('resize', this._handleNavPositioning);
}

public componentWillReceiveProps(nextProps: IAppProps): void {
if (nextProps && nextProps.children !== this.props.children) {
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}

public render(): JSX.Element {
let { navHeight } = this.state;
let navPosition: 'fixed' | 'absolute' = this.state.isAttached ? 'fixed' : 'absolute';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/fabric-website",
"comment": "When navigating to a new page, the page will now be scrolled to the top instead of whatever position of the page you were on.",
"type": "patch"
}
],
"packageName": "@uifabric/fabric-website",
"email": "[email protected]"
}