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

up-restore-scroll #25

dirkholzapfel opened this Issue Aug 1, 2017 · 2 comments


None yet
2 participants

dirkholzapfel commented Aug 1, 2017

We tried to update from 0.30.0 to 0.36.1.

After the update - when clicking an up-dash with up-restore-scroll="true" unpoly fails with the attached log.
The error occurs in restoreScroll().

The commit that introduced changed code to this function was: e673b2e#diff-c5eb160fb78f4fa757becb6f4a4ade82R435

 __ _____  ___  ___  / /_ __
/ // / _ \/ _ \/ _ \/ / // /  0.36.1
\___/_//_/ .__/\___/_/\_. / 
        / /            / /

Call `up.log.enable()` to enable logging for this session.
unpoly.js:2831 [UP] Preloading link jQuery.fn.init(1)
unpoly.js:2831 [UP] Re-using cached response for GET
unpoly.js:2831 [UP] Re-using cached response for GET
unpoly.js:2831 [UP] Extracting .js-publication_page_content from 10200 bytes of HTML
unpoly.js:2831 [UP] Saving scroll positions for URL (Object)
unpoly.js:2831 [UP] Adding history entry for (up:history:push (Object))
unpoly.js:2831 [UP] Advanced to location (up:history:pushed (Object))
unpoly.js:2831 [UP] Updating .js-publication_page_content
unpoly.js:2831 [UP] Destroying fragment <div class=​"test-publication_landing_page js-
publication_page_content              up-destroying" style=​"display:​ none;​">​…​</div>​ (up:fragment:destroy)
unpoly.js:2831 [UP] Compiling fragment <div class=​"js-publication_page_content" up-source=​"http:​/​/​​4000/​en/​hwm/​updates">​…​</div>​
unpoly.js:2831 [UP] Compiling '.sticky' on 1 element(s)
unpoly.js:2831 [UP] Compiling '.sticky' on <div class=​"publication_funding_status__wrapper sticky
unpoly.js:2831 [UP] Inserted fragment <div class=​"js-publication_page_content" up-source=​"http:​/​/​​4000/​en/​hwm/​updates">​…​</div>​ (up:fragment:inserted (Object))
unpoly.js:2831 [UP] Restoring scroll positions for URL to undefined
unpoly.js:5264 Uncaught TypeError: Cannot read property 'document' of undefined
at HTMLDocument.<anonymous> (unpoly.js:5264)
at Function.each (jquery.js?27d9:365)
at jQuery.fn.init.each (jquery.js?27d9:137)
at unpoly.js:5260
at (unpoly.js:3775)
at restoreScroll (unpoly.js:5259)
at Object.revealOrRestoreScroll (unpoly.js:5283)
at skipMorph (unpoly.js:7117)
at unpoly.js:7096
at (unpoly.js:3782)

This comment has been minimized.

dirkholzapfel commented Aug 1, 2017

This quickfix solves the problem for me (made directly in the JS file for testing):


This comment has been minimized.


triskweline commented Dec 6, 2017

This is fixed with the 0.50.0 release. Sorry it took a while!

@triskweline triskweline closed this Dec 6, 2017

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