Video-hub-app: Scroll back to original location when clicking 'UP' inside folder

Created on 3 Mar 2020  路  6Comments  路  Source: whyboris/Video-Hub-App

  1. When in _Folder View_ scroll down some distance,
  2. open a folder,
  3. click the up button
  4. notice that the app resets the scroll to the top of the page

It would be nice if it went back to roughly where you were before clicking on the folder.

This feature was requested by a user. Seems useful when navigating using folders.

Feels like it may be easy to implement:

  • for simplicity the feature could be available only for the _root_ folder
  • simply store the y-offset (or whatever number associated with it) in the component
  • make _virtual scroller_ scroll to there

    • it may be possible to use scrollToIndex or scrollToPosition in _virtual scroller_ to achieve this

feature request good first issue

All 6 comments

Alternative solution to apply to any number of nested folders:

  • Scroll to the imageElement representing the folder containing the first (or any) video you just came up from.

See here in image-viewer for an example.

That method allows you to move up one folder, showing more images, but scrolls back to the top right image in your current view. 馃槃

I discovered a bug in _ngx-virtual-scroller_ 馃槄
The scrollToPosition does not accept 0 ms 馃槗
I'll try to fix it 馃榿
https://github.com/rintoj/ngx-virtual-scroller/issues/420

Thank you @cal2195 for the code reference 馃 -- it was helpful 馃榿
I ended up using pixel offset because that maintained the scroll position more-exactly 馃憣

Does this only work for a single folder level? 馃

Yeah -- it's a really rough implementation only aiming to handle the _root_ level 馃槄

There is also breadcrumb navigation, so to handle all cases I'd have to keep track of depth (since up is not the only way to navigate).

Also I didn't add a reset when switching hubs, so it will navigate incorrectly the first time after using the folder navigation in one hub and switching to another if the user hasn't come back to _root_ level 馃し鈥嶁檪

While it's a hack-y implementation, it will handle (I think) 95% of the cases without causing any more discomfort than before, and significantly improving the navigation experience otherwise.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cal2195 picture cal2195  路  4Comments

cal2195 picture cal2195  路  6Comments

cal2195 picture cal2195  路  6Comments

whyboris picture whyboris  路  5Comments

Aer20 picture Aer20  路  6Comments