Editor: Fix publish panel pinning when navigating from My Sites #528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #368
This pull request seeks to resolve an issue where the publish panel would be incorrectly pinned when navigating to the My Sites section prior to visiting the post editor.
Before:
After:
Implementation notes:
This is admittedly a bit of a stop-gap fix, and is one we should revisit in the future. It's not ideal for us to be pulling offsets directly from the DOM from within a React component. That said, the behavior here should match the intention of the working behavior, i.e. to adjust the
top
attribute to account for the height of the master bar. It was previously working intermittently because thegetBoundingClientRect
of the<body>
element would change when navigating to the My Sites section. The#content
element is more reliable in this regard.Testing instructions:
Verify that the publish panel scroll pinning behaves as expected in the following flow.