Closed loic-d closed 5 years ago
Wondering if it's related to SSR in web?
At first I was thinking this was related to the latest frame changes but I just tested this playground and it's fine:
Add tags to your order.
Sell your products directly on Instagram by tagging products in your posts, to create a seamless shopping experience for your customers.
Removing SSR seems to have fixed the issue. Wondering why we are only getting the error now?
So we'll need to prevent rendering of Sticky on the server.
The offset is still there even when disabling SSR
🤔 This also works in the playground
Also affected by this 😢
Specifically, I'm affected by the bug where the position is wrong, and my sticky container is being overlapped by the TopBar.
Disabling SSR doesn't help either.
This is preventing the new <CollectionProductsSendTo />
from shipping:
@dleroux @maxariss So we have two issues:
I'm not convinced that ssr is the culprit because when we start scrolling the calculations should fix themselves with the exception of the top bar. The tobBarOffset
is calculated on ComponentDidMount
of the app provider so this should happen on the client only. In Quilt
the react-html
package adds display: none
to the body, so when we query the top bar clientHeight on mount clientHeight
will return 0. Not sure why this wasn't an issue before, maybe it was always in prod but we never saw it because internal routes weren't enabled.
In any case, switching display: none
to visibility: hidden
seems to fix the issue. Not sure what the repercussions would be but this also works to hide the css flicker. @lemonmade I see you recently touched this code. Do you see potential issues form switching display to visibility?
@dleroux @lemonmade Are either of you working on this issue? It's blocking the release of a feature we had planned to bug hunt two days ago
@dleroux I don't see a problem with it, no. If that is the source of this issue, it only affects dev, and might not actually be fixed in dev anyways because of how we inject the styles into the head after the JS loads (I am not positive that it will still break, but in dev it certainly corrects when you do anything that forces the sticky manager to recompute the position). Running the prod build will tell you for sure whether this is a development-only issue or not.
From what I see, production does not seem to be impacted.
I could reproduce the issue on a local branch and I could not reproduce anymore in production once it 🚢 'ed
Other than investigating i have not done additional work. It will need a change in Quilt. I will see if i can make time soon but if someone else has time go for it. @loic-d?
@dleroux Are you suggesting not to render the component on the server?
No. The react-html package in ‘Quilt’ sets the body style to ‘display: none’ while the page loads. We need to change that to ‘visibility: hidden’. Then we need a version bump and update web.
That will solve the top bar height to be registered in the ‘Sticky Manager’. I can’t reproduce your second issue but I have a feeling it’s related as well.
PR created for this: https://github.com/Shopify/quilt/pull/515
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.
Issue summary
The
Sticky
component seems to be impacting the initial rendering of the Automatic Discount page. The right column of the page is not rendered until you scroll. Then the sticky position is a bit off. I can't reproduce in production but I can on a local branch andmaster
. Removing theSticky
component fixed the issue.Expected behavior
The right column should be properly rendered and the sticky position should not be off.
Actual behavior
The right column is not properly rendered until you scroll in the page and the sticky position is off.
Steps to reproduce the problem
Reduced test case
The best way to get your bug fixed is to provide a reduced test case. This CodeSandbox template is a great starting point.
Specifications
3.5.0