polaris icon indicating copy to clipboard operation
polaris copied to clipboard

[Sticky] / Should not stick when content height is greater than available screen space

Open loic-d opened this issue 8 years ago • 6 comments

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:

screen shot 2018-11-30 at 10 30 16 am

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.

  1. Enter a long discount code (255 characters max)
  2. Scroll down to make the summary card sticky
  3. 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

loic-d avatar Nov 30 '18 15:11 loic-d

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?

loic-d avatar Mar 06 '19 19:03 loic-d

any thoughts on this?

vladucu avatar May 24 '19 12:05 vladucu

We should probably remove the sticky effect when the height of the sticky content is bigger than the available space.

loic-d avatar May 26 '19 09:05 loic-d

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.

ghost avatar Apr 29 '20 18:04 ghost

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. sticky

rabbit0321 avatar Sep 13 '20 15:09 rabbit0321

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.

ghost avatar Mar 16 '21 21:03 ghost