Widgets: Prevent checkValidity from running on a form when widget is first adding to sidebar.

Amends [41352].
See #23120.
Fixes #43003 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42521


git-svn-id: http://core.svn.wordpress.org/trunk@42350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2018-01-17 01:24:30 +00:00
parent 8bd98be63d
commit 443594dd00
3 changed files with 5 additions and 4 deletions

View File

@ -517,9 +517,10 @@ wpWidgets = {
save : function( widget, del, animate, order ) {
var self = this, data, a,
sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
form = widget.find( 'form' );
form = widget.find( 'form' ),
isAdd = widget.find( 'input.add_new' ).val();
if ( ! del && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
return;
}

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42492';
$wp_version = '5.0-alpha-42521';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.