Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Media Library: Flash of changing UI when closing. #17418

Closed spen closed 3 years ago

spen commented 7 years ago

Summary

While working on #17150 we noticed that when closing the media picker modal from the detail view, we see a quick flash of the media-modal view/content changing before the modal while the modal is closing, as seen here:

wp-calypso-esc1

This happens when closing the modal with the 'cancel' button, or when using the esc key.

Steps to reproduce

Notes

It seems we see this flash because of an update in state. We can see how the different views are rendered conditionally in this switch statement in /media-modal/index.jsx.

When we close the modal the onClose prop of the media-modal is called... media-modal/actions#resetMediaModalView is called too which looks to be what resets the view.

My gut tells me that delaying the reseting of this prop until after the modal has closed would do the trick (perhaps it needs a onClosed as well as a onClose callback, to handle such logic after the modal is done closing or something to that effect.

worldomonation commented 3 years ago

Hi! I'm performing triage on older bugs as part of Quality Squad's efforts to cut down on backlog issue counts.

As there has been no recent activity on this issue, the issue is being closed with the label Closed - Not Reproducible. If work is scoped and tabled for a milestone, please feel free to re-open this bug.