WordPress.org

Make WordPress Core

Changeset 44474


Ignore:
Timestamp:
01/08/2019 04:41:53 PM (8 months ago)
Author:
desrosj
Message:

Widgets: Fix custom HTML widget editor content not updating after save.

An integer comparison is performed against control.currentErrorAnnotations, but control.currentErrorAnnotations is actually an array. This fixes that comparison so the content saves correctly.

Props barryceelen.
Fixes #43657.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/widgets/custom-html.js

    r43347 r44474  
    113113             * the editor. This is particularly important for users who cannot unfiltered_html.
    114114             */
    115             control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations;
     115            control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations.length;
    116116            if ( ! control.contentUpdateBypassed ) {
    117117                syncInput = control.syncContainer.find( '.sync-input.content' );
Note: See TracChangeset for help on using the changeset viewer.