-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual Scroll Plugin scrolls to top when next url loads #556
Comments
For comparison, using Chrome in Android it works properly. |
This is how I'm currently working around this, in my let dropdown = document.getElementById('global-search-ts-dropdown');
if (query != last_query) {
last_scroll_position = 0;
} else if (dropdown) {
last_scroll_position = dropdown.scrollTop;
}
last_query = query; Then I do all my ajax loading. After I've executed the callback, I set the scrollTop again: callback(res.list);
dropdown.scrollTop = last_scroll_position; |
This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days |
This is still an issue in version 2.3.4 The workaround that I currently use monkeypatches fetch(url)
.then(response => response.json())
.then(json => {
const _scrollToOption = this.scrollToOption
this.scrollToOption = () => {}
callback(json.results)
this.scrollToOption = _scrollToOption |
No news about this issue? |
Tracked this one down to |
@skerit can you share your solution, please? |
Describe the bug
Each time nextUrl loads on the Virtual Scroll examples on the tom-select website, the select scrolls all the way back to the top of results, which is a frustrating user experience.
To Reproduce
View Virtual Scroll examples at https://tom-select.js.org/plugins/virtual_scroll/ or https://tom-select.js.org/plugins/ and scroll far enough to load more than one url's worth of options.
Expected behavior
The new content is appended, and user can scroll from the position which used to be the bottom (and is now the top of the new set of results).
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: