Fixes #697
This commit is contained in:
@@ -5,9 +5,16 @@ import { withRouter } from 'react-router-dom';
|
||||
|
||||
class ScrollToTop extends React.Component<*> {
|
||||
componentDidUpdate(prevProps) {
|
||||
if (this.props.location !== prevProps.location) {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
if (this.props.location.pathname === prevProps.location.pathname) return;
|
||||
|
||||
// exception for when entering or exiting document edit, scroll postion should not reset
|
||||
if (
|
||||
this.props.location.pathname.match(/\/edit\/?$/) ||
|
||||
prevProps.location.pathname.match(/\/edit\/?$/)
|
||||
)
|
||||
return;
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
"react-waypoint": "^7.3.1",
|
||||
"redis": "^2.6.2",
|
||||
"redis-lock": "^0.1.0",
|
||||
"rich-markdown-editor": "1.4.0-2",
|
||||
"rich-markdown-editor": "1.4.1",
|
||||
"safestart": "1.1.0",
|
||||
"sequelize": "4.28.6",
|
||||
"sequelize-cli": "^2.7.0",
|
||||
|
||||
@@ -8859,9 +8859,9 @@ retry-axios@0.3.2, retry-axios@^0.3.2:
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/retry-axios/-/retry-axios-0.3.2.tgz#5757c80f585b4cc4c4986aa2ffd47a60c6d35e13"
|
||||
|
||||
rich-markdown-editor@1.4.0-2:
|
||||
version "1.4.0-2"
|
||||
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-1.4.0-2.tgz#5d8795cef27e0c48ba5689be43dd02a1a0c02368"
|
||||
rich-markdown-editor@1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-1.4.1.tgz#c339e216009e44a17427843f80847f8cfcb815c7"
|
||||
dependencies:
|
||||
"@tommoor/slate-drop-or-paste-images" "^0.8.1"
|
||||
boundless-arrow-key-navigation "^1.1.0"
|
||||
|
||||
Reference in New Issue
Block a user