Make WordPress Core

Changeset 42521


Ignore:
Timestamp:
01/17/2018 01:23:39 AM (7 years ago)
Author:
westonruter
Message:

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/widgets.js

    r42403 r42521  
    518518        var self = this, data, a,
    519519            sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
    520             form = widget.find( 'form' );
    521 
    522         if ( ! del && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
     520            form = widget.find( 'form' ),
     521            isAdd = widget.find( 'input.add_new' ).val();
     522
     523        if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
    523524            return;
    524525        }
Note: See TracChangeset for help on using the changeset viewer.