Fix Page numbers don't update when navigating with thumbnails #202
+1
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Ref: https://github.com/allenai/scholar/issues/33968
Since we recently are having issue with PageNumberControl due to user scrolls speed so this PR addresses this.
Reviewer Instructions
According to the video in the beginning Smita is already at page 15 but the page control is displaying it as page 6 so this can be the case that Smita scrolled faster than IntersectionObserver API picks up the change so that's why our page control can't update accordingly. So i change the threshold to 0 which mean if as soon as a tiny bit of the div is visible, IntersectionObserver will kick in.
Testing Plan
Verify when scroll manually through the page, the page number updated accordingly. Also when clicking thumbnail or TOC it will update the page number accordingly.
Output / Screenshots
Screen.Recording.2022-10-11.at.2.38.11.PM.mov
A11y
N/A