On Bug Bash we noticed that when we click on any section of TOC. It will scroll to the position and at the same time collapse header which is not desirable. This PR addresses this issue.
Reviewer Instructions
I created a useState called IsOutlineGetClicked and when it get clicked this will set to true (this happens inside ScrollContext since when we click on Outline it will call scrollToOutlineTarget in ScrollContext). But on user mouse wheel in general it will set to false so the header will collapse like normal (scroll doesn't work since it not count toward user actually scroll).
Testing Plan
To verify it works in Prod. In ReaderHeader i specifically add code like below to verify it works. Other than that yarn format, lint, test.
Description
Ref: https://github.com/allenai/scholar/issues/33326
On Bug Bash we noticed that when we click on any section of TOC. It will scroll to the position and at the same time collapse header which is not desirable. This PR addresses this issue.
Reviewer Instructions
I created a useState called
IsOutlineGetClicked
and when it get clicked this will set to true (this happens insideScrollContext
since when we click on Outline it will callscrollToOutlineTarget
inScrollContext
). But on user mouse wheel in general it will set to false so the header will collapse like normal (scroll doesn't work since it not count toward user actually scroll).Testing Plan
To verify it works in Prod. In ReaderHeader i specifically add code like below to verify it works. Other than that yarn format, lint, test.
ReaderHeader Reader
Output / Screenshots
https://user-images.githubusercontent.com/84343285/186518383-3c441b23-33a1-44ad-b205-32c5b887a9e0.mov
A11y
No A11y involvement