Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add topOffset prop to the StickySection #1018

Merged
merged 1 commit into from
Aug 8, 2019
Merged

Add topOffset prop to the StickySection #1018

merged 1 commit into from
Aug 8, 2019

Conversation

jhsu
Copy link
Collaborator

@jhsu jhsu commented Aug 8, 2019

problem

When using StickySection, it sticks to the top of the document, but if there is a navbar or some content above, it will overlap.

proposal

This adds a new topOffset prop that will use it as a top threshold before it becomes sticky. It will display with that topOffset when sticky.

Copy link
Contributor

@jondlm jondlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition!

@codecov-io
Copy link

Codecov Report

Merging #1018 into master will increase coverage by <.01%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master    #1018      +/-   ##
==========================================
+ Coverage   90.06%   90.06%   +<.01%     
==========================================
  Files         186      186              
  Lines        3715     3716       +1     
  Branches     1231     1231              
==========================================
+ Hits         3346     3347       +1     
  Misses        344      344              
  Partials       25       25
Impacted Files Coverage Δ
src/components/StickySection/StickySection.jsx 43.39% <33.33%> (+1.08%) ⬆️

@jhsu jhsu merged commit 66126ca into master Aug 8, 2019
@jhsu jhsu deleted the sticky-offset branch August 8, 2019 20:41
jhsu pushed a commit that referenced this pull request Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants