-
Notifications
You must be signed in to change notification settings - Fork 59
Prevent issues when storing the top offset in AdjustableSidebarWidth #826
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
Prevent issues when storing the top offset in AdjustableSidebarWidth #826
Conversation
@marinaaisa are there testing instructions you can add to this? |
Ops, sure, I just added them. |
Thank you Marina for investigating this issue and explaining it. I think I may (or may not) have found a better way to fix this. If I understood this correctly, the issue is that the offset we fetch of It's a bit hard to explain as well, but let me know if you think this makes sense? |
@@ -216,7 +217,6 @@ export default { | |||
if (this.focusTrapInstance) this.focusTrapInstance.destroy(); | |||
}); | |||
|
|||
await this.$nextTick(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this was initially meant to wait for. But would we still need this to ensure everything is updated before focus trapping?
Sounds right, but I think it's still a timing problem as you describe it. If I remember correctly, this placeholder is added to avoid an awkward situation before the routing and data fetching occurs so that the page doesn't look super compact and weird with the header/footer squashed together. I would still consider it a timing issue though, because basically you need to wait for the time required for That also explains why this bug could happen, because I assume it's adding the height of the placeholder to the calculation if the calculation happens before it is removed (which is variable depending on the height of the window)—and by moving the placeholder below this anchor, its height wouldn't impact that calculation anymore. |
2ef86b0
to
79deebf
Compare
79deebf
to
c07a2e6
Compare
It's a really good point. I'm going to leave it as it is, then. |
Ops I was working on fixing tests. In case we still want to go with the placeholder approach I have that here: hqhhuang@78edb51 |
I think the placeholder approach might be better—just wanted to highlight that it is still a problem caused by the timing of the placeholder getting removed. Sorry if I was unclear! |
Okay, @hqhhuang , could you cherry pick your commit into this branch then? |
move `loadingPlaceHolder` below `header`
@mportiz08 Do you mind giving it another look? |
Revert "nextTick" approach
@swift-ci test |
…wiftlang#826) Moving the placeholder element helps resolve an issue where an offset for the navigator may be incorrectly calculated when the initial loading placeholder is still on-screen, since it takes up the full viewport height. Resolves: rdar://128197719 Co-authored-by: Hanqing Huang <[email protected]>
…826) (#827) Moving the placeholder element helps resolve an issue where an offset for the navigator may be incorrectly calculated when the initial loading placeholder is still on-screen, since it takes up the full viewport height. Resolves: rdar://128197719 Co-authored-by: Marina Aísa <[email protected]> Co-authored-by: Hanqing Huang <[email protected]>
Bug/issue #128197719, if applicable:
Summary
Make sure the page is fully loaded before storing top offset in AdjustableSidebarWidth
Dependencies
NA
Testing
Steps:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded