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

MediaUpload: Remove dialog markup on close #62168

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/media-utils/src/components/media-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ class MediaUpload extends Component {
if ( onClose ) {
onClose();
}

this.frame.detach();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work, but it looks like the detach() method calls close as well, so you might be able to bind the 'close' event directly to detach similar to how the EditAttachments frame works: https://github.com/WordPress/wordpress-develop/blob/trunk/src/js/media/views/frame/edit-attachments.js#L68

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the difference between binding detach directly to the event vs calling it from the binded callback?

I think they will be the same in this code base.

}

updateCollection() {
Expand Down
Loading