With the new reader layout now using the outer scroll instead of the inner one which will render our scroll.ts to be useless. Its originally was targeting reader__page-list but now the scroll is on react-pdf__Document reader__main
Reviewer Instructions
My thought originally was tagging all the page with a ref which is the way that Yensung did too. So i tagged every page in the list with the ref and save the ref in the DocumentContext and pass that ref into the scroll.ts, instead of directly creating the target div, i use parentNode property of the ref and execute scroll directly on that parent since every page only has one relative parent that is react-pdf__Document reader__main
Testing Plan
Manually test by clicking all the option of TOC and expect them to be able to scroll to the correct position. Other than that lint and format.
Description
Ref: https://github.com/allenai/scholar/issues/32270
With the new reader layout now using the outer scroll instead of the inner one which will render our
scroll.ts
to be useless. Its originally was targetingreader__page-list
but now the scroll is onreact-pdf__Document reader__main
Reviewer Instructions
My thought originally was tagging all the page with a
ref
which is the way that Yensung did too. So i tagged every page in the list with the ref and save theref
in theDocumentContext
and pass thatref
into thescroll.ts
, instead of directly creating the target div, i useparentNode
property of the ref and execute scroll directly on that parent since every page only has one relative parent that isreact-pdf__Document reader__main
Testing Plan
Manually test by clicking all the option of TOC and expect them to be able to scroll to the correct position. Other than that lint and format.
Output / Screenshots
https://user-images.githubusercontent.com/84343285/175996038-9272c210-75d0-43f0-8fb8-022e72036a33.mov
A11y
No A11y involvement in this