Wp-calypso: Editor: link modal & media modal keep scrolling up to the top

Created on 3 Aug 2017  路  11Comments  路  Source: Automattic/wp-calypso

2017-08-03 15 34 07

When the media modal opens, the page gets scrolled up to the top.

To Reproduce

  1. Open the Editor
  2. Have a long post, so it's scrolled down
  3. Insert an image, or do any operation opening the media modal while scrolled down (edit).

The page will scroll up as soon as the media modal opens.

I ranked this "High priority" as it's a very frustrating disruption for anyone writing a post with images.

Editor Media [Pri] High [Type] Bug

Most helpful comment

Sorry for the late reply, I've been afk. Looks like this is causing the issue.

That style was added so that the content _behind_ the dialog doesn't scroll when the dialog itself is visible.

However, that class is added intermittently. Even in the latest version of react-modal.

For now, the safest/quickest solution would be to simply remove that style.

All 11 comments

Tested and confirmed that when I am editing at the end of a long post that requires scrolling and I insert an image I am scrolled up to the top and the image is out of view.

Video: 20s
Seen at https://wordpress.com/post/design5279.wordpress.com/11374 using Firefox 54.0.1 on Mac OS X 10.12.6.

Could this be related to #16245?

Confirmed this issue and I can confirm it's recent since the WordPress.com desktop app doesn't contain this bug. I think we should keep the [Pri] High label

Also reported in #16741

This happens with the Insert Link modal as well, not just media.

Several user reports in the other issue. Adding 872899-f for follow-up.

Could this be a side effect of the work that was done in https://github.com/Automattic/wp-calypso/pull/15718 to make dialogs (modals like these) scrollable in smaller windows? cc @jameskoster

Could this be a side effect of the work that was done in聽#15718聽to make dialogs (modals like these) scrollable in smaller windows? cc聽@jameskoster

Reverting the changes from the the PR locally fix the issue.

At a quick glance I don't see any changes in #15718 that would cause a change in position other than the updated react-modal version - That'd be worth exploring.

This was also reported in 618738-zen and I was able to replicate by inserting a link at the bottom of the page editor in the latest version of Chrome/macOS Sierra.

Sorry for the late reply, I've been afk. Looks like this is causing the issue.

That style was added so that the content _behind_ the dialog doesn't scroll when the dialog itself is visible.

However, that class is added intermittently. Even in the latest version of react-modal.

For now, the safest/quickest solution would be to simply remove that style.

Reopening this issue since it is still present.

Was this page helpful?
0 / 5 - 0 ratings