When the media modal opens, the page gets scrolled up to the top.
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.
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.
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.