Widgets: Allow deletion even when widget form fails validity checks.

Props felipeelia.
Amends [41352].
See #23120.
Fixes #42127.


git-svn-id: https://develop.svn.wordpress.org/trunk@41813 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2017-10-10 18:06:24 +00:00
parent cdba279149
commit 6bbf13852b

View File

@ -515,7 +515,7 @@ wpWidgets = {
sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
form = widget.find( 'form' );
if ( form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
if ( ! del && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
return;
}