From 0f618b4f30881ed179c077e845a998bf876a9ecb Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 7 Mar 2019 22:25:55 +0000 Subject: [PATCH] Widgets: Remove `change` event when editing a Custom HTML widget. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/js/_enqueues/wp/widgets/custom-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/widgets/custom-html.js b/src/js/_enqueues/wp/widgets/custom-html.js index 6cc4835eeb..93aa901c2f 100644 --- a/src/js/_enqueues/wp/widgets/custom-html.js +++ b/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() ); } },