[Sticky] / Should not stick when content height is greater than available screen space
Issue summary
In cases where the content height of the Sticky component is greater than the available screen space, we should remove the sticky effect.
Example of the issue with a Card component wrapped by Sticky:
Expected behavior
When the sticky content does not fit on the screen, the sticky effect should be removed. This way, the sticky content would not overlap with other content (main page action in this case).
Actual behavior
When the sticky content does not fit on the screen, the sticky effect is still applied.
Steps to reproduce the problem
To reproduce you can look at the discounts page.
- Enter a long discount code (255 characters max)
- Scroll down to make the summary card sticky
- The sticky card overlaps with the main page action button
Reduced test case
Partial JSX Markup
<Layout.Section secondary>
<Sticky offset disableWhenStacked>
Summary card content
</Sticky>
</Layout.Section>
<Layout.Section>
<PageActions {...pageActions} />
</Layout.Section>
Specifications
- Are you using the React components? (Y/N): Y
- Polaris version number:
"@shopify/polaris": "3.1.1" - Browser:
Version 70.0.3538.102 (Official Build) (64-bit) - Device: Mac OS X
- Operating System:
10.13.6
This came up again in an internal bug hunt. Is this something you guys plan on tackling soon or should we take care of it?
any thoughts on this?
We should probably remove the sticky effect when the height of the sticky content is bigger than the available space.
This issue has been inactive for 180 days and labeled with Icebox. It will be closed in 7 days if there is no further activity.
I have met the same issue when using Sticky component. It also overlaps with my contextual save bar even I set offset true to Sticky component. Is it possible to customize the sticky timing by setting boundingElement props? Not sure how to use it correctly.

This issue has been inactive for 180 days and labeled with Icebox. It will be closed in 7 days if there is no further activity.