[wp-trac] [WordPress Trac] #44284: Remove e.preventDefault(); code line from widgets.js file

WordPress Trac noreply at wordpress.org
Thu May 31 19:46:24 UTC 2018

#44284: Remove e.preventDefault(); code line from widgets.js file
 Reporter:  alexvorn2                          |       Owner:  (none)
     Type:  defect (bug)                       |      Status:  new
 Priority:  normal                             |   Milestone:  Awaiting
                                               |  Review
Component:  Widgets                            |     Version:  4.9.6
 Severity:  normal                             |  Resolution:
 Keywords:  has-screenshots reporter-feedback  |     Focuses:

Comment (by alexvorn2):

 It does not cause an error but the problem is that I can not save the
 widget settings, if I have an input with min value = 1, and if I insert
 value 0..

 see this example:
 <input type="number" name="name_here" min="1">

 if I insert into the input field "0", then the widget will not be saved
 and no notification will show because we have e.preventDefault(); function
 that blocks notifications...

 The line to be removed in file wp-admin/js/widgets.js is 182.

 } else if ( target.hasClass('widget-control-save') ) {
         wpWidgets.save( target.closest('div.widget'), 0, 1, 0 );

Ticket URL: <https://core.trac.wordpress.org/ticket/44284#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list