allenai / pdf-component-library

44 stars 4 forks source link

Add Scroll Context to PDF Component #142

Closed huytr1995 closed 2 years ago

huytr1995 commented 2 years ago

Description

Ref: https://github.com/allenai/scholar/issues/32115 To be able to make the ticket above work we need the ScrollContext.ts to be in PDF repo and publish it so we can start importing it in S2 to use the direction to hide and show the Header.

Reviewer Instructions

@pauls-ai2 per our discussion we need to extract your big PR into chunk as mentioned yesterday. This is just get the logic in first while i have time to refactor a bit on the ScrollContext and create unit test for it.

Testing Plan

Bring in my changes that you suggested into your OG PR and verified if the console.log actually pick up the direction when scrolling

Output / Screenshots

https://user-images.githubusercontent.com/84343285/179293768-04b5fca0-dd1e-4f07-94d8-9ec9f8e8b62f.mov

A11y

No A11y involvement