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.

Fixes #45335.
Props audrasjb, afercia, westonruter.

git-svn-id: https://develop.svn.wordpress.org/trunk@44816 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2019-03-07 22:25:55 +00:00
parent 8ae4796288
commit 0f618b4f30

View File

@ -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() );
}
},