Scroll to top does not work
See original GitHub issueI’m submitting a … (check one with “x”)
[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior Have a table with h and v scrolling. Scroll to the bottom, reload the rows and set offset to 0 to move the scroll position to the top. However, it does not affect the scroll position.
Expected behavior Move to the top when this.table.offset = 0
Reproduction of the problem https://plnkr.co/edit/iGyPA7TD46Y8BfSjVA7L
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- Table version: 0.7.x
- Angular version: 2.0.x
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
- Language: [all | TypeScript X.X | ES6/7 | ES5]
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Need to scroll to the top of the page? - CSS-Tricks
I've found back-to-top anchors work even if the ID/class for “top” is not defined. However smooth scrolling does need a target anchor or...
Read more >How to scroll to top of page with JavaScript/jQuery?
When I scroll my page half way down, then trigger a reload, I want the page to go pack to the top, but...
Read more >Can't Fix – Won't Scroll to Top | WordPress.org
I tried the solutions here https://wordpress.org/support/topic/wont-scroll-back-to-top/ but they didnt work, in fact the last one killed my site.
Read more >overflow-x - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, ...
Read more >Scroll to Top does not work in drawer-content #431 - GitHub
Thanks @saadeghi Using document.querySelector('.drawer-content').scrollTo({ top: 0 }) worked!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would exposing
this.bodyComponent.updateOffsetY(this.offset);
help you?Also running into this, as a work around you can call
this.table.element.getElementsByTagName('datatable-body')[0].scrollTop = 1;
once you’ve updated the rows which causes the hidden rows to be displayed