Skip to content

Commit d659dc1

Browse files
committed
Fix: image caption disappears
1 parent 2802727 commit d659dc1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/media/views/attachments.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,13 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{
293293

294294
// Record the initial `index` of the dragged model.
295295
start: function( event, ui ) {
296-
ui.item.data('sortableIndexStart', ui.item.index());
296+
/*
297+
* Ensure that any caption that currently has focus and has potentially been changed
298+
* is saved before the media is reordered, which would reset the caption.
299+
*/
300+
$( 'input.describe:focus').trigger( 'change' );
301+
302+
ui.item.data('sortableIndexStart', ui.item.index());
297303
},
298304

299305
/*

0 commit comments

Comments
 (0)