diff --git a/packages/media-utils/CHANGELOG.md b/packages/media-utils/CHANGELOG.md index 4f02a7a4d92375..24722cd2a07c0f 100644 --- a/packages/media-utils/CHANGELOG.md +++ b/packages/media-utils/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fixes + +- Fix a `TypeError` when opening the image editor for an image in an existing gallery, by removing the redundant `edit-image` handler in the gallery details frame. + ### Internal - Remove the `window.__heicUploadSupport` type declaration, following the removal of the redundant flag ([#80452](https://github.com/WordPress/gutenberg/pull/80452)). diff --git a/packages/media-utils/src/components/media-upload/index.js b/packages/media-utils/src/components/media-upload/index.js index 678f92d78b6d84..29239c7bffdfb9 100644 --- a/packages/media-utils/src/components/media-upload/index.js +++ b/packages/media-utils/src/components/media-upload/index.js @@ -173,25 +173,6 @@ const getGalleryDetailsMediaFrame = () => { ); }, - /** - * Handle the edit state requirements of selected media item. - * - * @return {void} - */ - editState() { - const selection = this.state( 'gallery' ).get( 'selection' ); - const view = new wp.media.view.EditImage( { - model: selection.single(), - controller: this, - } ).render(); - - // Set the view to the EditImage frame using the selected image. - this.content.set( view ); - - // After bringing in the frame, load the actual editor via an ajax call. - view.loadEditor(); - }, - /** * Create the default states. * @@ -199,7 +180,6 @@ const getGalleryDetailsMediaFrame = () => { */ createStates: function createStates() { this.on( 'toolbar:create:main-gallery', this.galleryToolbar, this ); - this.on( 'content:render:edit-image', this.editState, this ); this.states.add( [ new wp.media.controller.Library( {