We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2802727 commit d659dc1Copy full SHA for d659dc1
src/js/media/views/attachments.js
@@ -293,7 +293,13 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{
293
294
// Record the initial `index` of the dragged model.
295
start: function( event, ui ) {
296
- ui.item.data('sortableIndexStart', ui.item.index());
+ /*
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());
303
},
304
305
/*
0 commit comments