pimusicbox / mopidy-musicbox-webclient

Web Client for Mopidy Music Server and the Pi MusicBox
https://www.pimusicbox.com
Apache License 2.0
399 stars 106 forks source link

Some scrolling oddities when changing views #73

Closed EHLOVader closed 7 years ago

EHLOVader commented 9 years ago

I did notice, along the lines of #71 and scrolling the view that the view isn't scrolled on view changes.

The scrollbar appears to remain at the same length value, which if the new view is shorter will result in arriving at the bottom of the page and if the new view was actually quite a bit longer it will be at some point in the middle. I think it would be nice to scroll to the top on new page view loads as a courtesy.

kingosticks commented 9 years ago

Is this https://github.com/woutervanwijk/Mopidy-MusicBox-Webclient/issues/38 ?

EHLOVader commented 9 years ago

Nope, it is different. This may affect it though. In this case the steps to reproduce the behavior are as seen below.

you need a long playlist and a short playlist.

  1. Fill the play queue with a lot of songs. but somewhere between the length of the above two playlists.
  2. open the short playlist.
  3. Scroll to the bottom.
  4. Switch to the queue.

What is expected is the queue being at the top or last location it was at. However you end up at the scroll value of the short playlist, somewhere in the middle.

  1. Now go to the long playlist, the same should be true.
  2. Scroll all the way to the bottom.
  3. Switch to the queue.

What is expected is that the queue will be scrolled to the top or where you last left it. However since the playlist was longer than the queue, the page is scrolled all the way to the bottom.

This also happens if you scroll to the bottom of the queue, and then switch to the short playlist.

kingosticks commented 9 years ago

Ahh ok I follow you now. Yeh, let's fix it.

kingosticks commented 9 years ago

So there's a proposed fix in #93 and there's a similar idea at http://stackoverflow.com/questions/11216392/how-to-handle-scroll-position-on-hashchange-in-backbone-js-application. The latter might be a little neater but I'm open to whatever works.

simsasaile commented 9 years ago

Looking really forward for this fix!

At the moment it's really annoying to browse through the library :(

simsasaile commented 9 years ago

Just a hint: Mopidy-Mobild can remember the scroll-position: https://github.com/tkem/mopidy-mobile Maybe it could be done in the same way?