Skip to content
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

Editor: Fix publish panel pinning when navigating from My Sites #528

Merged
merged 1 commit into from
Nov 25, 2015

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Nov 23, 2015

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:

Before

After:

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 the getBoundingClientRect 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.

  1. Navigate to the Reader
  2. Click My Sites in the master bar
  3. Click the New Post (pencil) button in the master bar
  4. Select a site, if prompted
  5. Scroll the page enough to cause the publish panel to be pinned
  6. Note that the publish panel is pinned to the bottom of the master bar, not the top of the page

@aduth aduth added [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 23, 2015
@aduth aduth self-assigned this Nov 23, 2015
@kellychoffman
Copy link
Member

👍

@aduth aduth added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 25, 2015
aduth added a commit that referenced this pull request Nov 25, 2015
Editor: Fix publish panel pinning when navigating from My Sites
@aduth aduth merged commit aabedf7 into master Nov 25, 2015
@aduth aduth deleted the fix/368-editor-scroll-pin branch November 25, 2015 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Status] In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor: Sidebar vertically misaligned on scroll
4 participants