Skip to content

Conversation

@amatakasap
Copy link

Could not restore scroll position using scrollBehavior of vue-router.
Therefore, we added pageMode to change the scroll target to "window".

@tangbc
Copy link
Owner

tangbc commented Dec 29, 2018

Can you give a demo or case ? I don't think it's very useful.

@ConfusedCitizen
Copy link

ConfusedCitizen commented Jan 25, 2019

@amatakasap Thank you for this - this was exactly what I was looking for!

@tangbc The feature makes the scroller for the Virtual Scroller List use the windows scroll-bar instead of the div scrollbar - so the virtual scrolling is hidden and the standard window scrollbar is used in place.

Edit: Upon playing around with the pagemode changes some more - it looks like your Offset calculation needs adjusting for when the Virtual-scroll-list is not the first item in the Window. Just deducting the Virtual List elements top offset from the Window Y-axis offset seems to have corrected the calculation. 👍

var offset = this.pageMode ? window.pageYOffset - $(this.$el).offset().top : (vsl && (vsl instanceof Vue2 ? vsl.$el : vsl).scrollTop) || 0

@tangbc
Copy link
Owner

tangbc commented Feb 2, 2019

Is it better to provide a prop scrollElement type is selector string or a element to controll scrollBehavior?

@ConfusedCitizen
Copy link

I'm not sure I totally understand the question - but I think you're referring to the pageMode prop that is part of the changes?
Could you please clarify the question?

@tangbc
Copy link
Owner

tangbc commented Feb 13, 2019

@ConfusedCitizen In this case remain and size assign what ?

@ConfusedCitizen
Copy link

@tangbc remain and size remain functionally the same - this change is merely an adjustment to utilise the Window scrollbar instead of a container scrollbar.
If I have some time tomorrow/weekend I'll try to put together a demo of the pageMode.

@tangbc
Copy link
Owner

tangbc commented Feb 15, 2019

@ConfusedCitizen It would be better if you could do that. I'm still confused about the scene. 😳

@ConfusedCitizen
Copy link

@tangbc spent an hour putting together a demo on Sunday only to have my PC crash and lose all the work.
I'll try to find some time this week to put together another one :(

@ConfusedCitizen
Copy link

hey @tangbc, sorry for the long delay - it's been a hectic few months at work.
Here is a very rough sample demo with pageMode enabled.

I have also included the latest version of the plugins index.js with the pageMode changes along with the demo.
Let me know if it's not working for you :)

Cheers,
ConfusedCitizen

pagemode-demo.zip

@tangbc
Copy link
Owner

tangbc commented Apr 10, 2019

ok, I will check later.

@Stormtv
Copy link
Contributor

Stormtv commented May 7, 2019

This PR helped me, my UI is using a combination of fixed headers / footers a large center data list (using this lib) and an affixed sidebar that scrolls with the content using https://github.com/eddiemf/vue-affix scroll. Therefore it was ideal to only use the window scrollbar instead of a nested scroll bar.

@tangbc
Copy link
Owner

tangbc commented Jun 28, 2019

Already pr by #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants