Skip to content

Fix scroll to answer

Thomas Gassmann requested to merge fix-scroll-to-answer into master

Currently opening an answer via a direct link (i.e. with the hash in the URL) results in strange behavior where the element is being repeatedly scrolled into view. I believe this was caused by an unnecessary rerender of the HashLocationHandler component. Also, if the component gets rerendered, cleanup isn't being done properly. Previously the exam page would also jump to the location itself, now that's only the responsibility of HashLocationHandler.

Maybe we could also reconsider the entire HashLocationHandler entirely at some point, it seems a bit hacky and there might be better solutions with newer versions of react-router.

Edited by Thomas Gassmann

Merge request reports

Loading