mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

Scroll position is maintained for new pages #9943

Closed muffinresearch closed 8 years ago

muffinresearch commented 8 years ago

Describe the problem and steps to reproduce it:

What happened?

The details page is loaded at the same scroll position as the click:

e.g:

add-ons_for_firefox

What did you expect to happen?

The scroll position should be the top of a new page after navigating. However, clicking back should keep the original scroll position.

tofumatt commented 8 years ago

Oh thanks for reporting this, it’s an issue across the site that’s been irking me. I think we’ll want to move the page position to .App-content (below the search bar) after any route change.

muffinresearch commented 8 years ago

There are router middlewares to deal with this in relation to history: https://github.com/taion/react-router-scroll which is probably what we want.

muffinresearch commented 8 years ago

I'll try out the middleware and report back. Looks to work correctly so I'm making a PR.

ValentinaPC commented 7 years ago

Verified as fixed using https://amo.addons-dev.allizom.org/en-GB/firefox/ in responsive mode under FF51(Win 7) and AMO-dev on my Android 6.0.1 device. Postfix video: videotogif_2017 02 07_12 43 11