diff --git a/src/js/media/views/attachments/browser.js b/src/js/media/views/attachments/browser.js index 82b7359eb832a..cf092ea346bb4 100644 --- a/src/js/media/views/attachments/browser.js +++ b/src/js/media/views/attachments/browser.js @@ -720,8 +720,11 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro }) ); } - // Show the sidebar on mobile. - if ( this.model.id === 'insert' ) { + // Show the sidebar on mobile for flows that surface attachment + // metadata (alt text, caption, description) in the sidebar. Without + // this, the sidebar is positioned off-screen on narrow viewports + // and the metadata fields are unreachable. + if ( [ 'insert', 'featured-image', 'replace-image', 'gallery-edit', 'gallery-library', 'library' ].includes( this.model.id ) ) { sidebar.$el.addClass( 'visible' ); } },