Add scroll to top on navigate action
This commit is contained in:
@@ -29,6 +29,7 @@ const historyManager = store => {
|
|||||||
|
|
||||||
return next => action => {
|
return next => action => {
|
||||||
if(action.type === NAVIGATE && action.pushToHistory === true) {
|
if(action.type === NAVIGATE && action.pushToHistory === true) {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
history.push(`/${action.pageName}.html`);
|
history.push(`/${action.pageName}.html`);
|
||||||
}
|
}
|
||||||
return next(action);
|
return next(action);
|
||||||
|
|||||||
Reference in New Issue
Block a user