WordPress.org

Make WordPress Core

Ticket #27139: 27139.3.patch

File 27139.3.patch, 610 bytes (added by cfinke, 10 months ago)

Fixes the issue in version 5.6.1 by triggering the focused caption input's change event before a reorder happens.

  • js/media/views/attachments.js

     
    285285
    286286                        // Record the initial `index` of the dragged model.
    287287                        start: function( event, ui ) {
     288                                // Ensure that any caption that currently has focus and has potentially been changed
     289                                // is saved before the media is reordered, which would reset the caption.
     290                                $( 'input.describe:focus').trigger( 'change' );
     291
    288292                                ui.item.data('sortableIndexStart', ui.item.index());
    289293                        },
    290294