Skip to content
Permalink
Browse files

Widgets: Remove `change` event when editing a Custom HTML widget.

The `change` event was previously required to ensure that the Customizer picked detected changes to the widget's content and synced them to the preview. In the current state, though, the `trigger( 'change' )` is no longer required and is causing issues with the widget's “Done” and “Save” buttons.

Merges [44816] to the 5.1 branch.

Fixes #46335.
Props audrasjb, afercia, westonruter.

git-svn-id: https://develop.svn.wordpress.org/branches/5.1@44817 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Mar 7, 2019
1 parent 85076ad commit 057d0fbff12bc7c3761daf8985010f4b0a84c9ad
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/js/_enqueues/wp/widgets/custom-html.js
@@ -115,7 +115,7 @@ wp.customHtmlWidgets = ( function( $ ) {
control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations.length;
if ( ! control.contentUpdateBypassed ) {
syncInput = control.syncContainer.find( '.sync-input.content' );
control.fields.content.val( syncInput.val() ).trigger( 'change' );
control.fields.content.val( syncInput.val() );
}
},

0 comments on commit 057d0fb

Please sign in to comment.
You can’t perform that action at this time.