Widgets: Prevent `checkValidity` from running on a form when widget is first adding to sidebar.
Amends [41352]. See #23120. Fixes #43003 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@42521 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
16f9dea4ab
commit
505a939720
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue