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

WordPress Trac noreply at wordpress.org
Fri Jun 1 15:44:40 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):

 Replying to [comment:4 woodent]:
 > @alexvorn2 The message you are seeing has nothing to do with the
 JavaScript. It is a browser based validation that is occurring because the
 input field has a min value of 1 applied in the HTML. If this is a custom
 widget you are creating, you should be able to change the min attribute in
 the HTML to 0 if you want to allow a 0 value.

 You don't understand!
 The screenshot is after I remove this function "e.preventDefault();" ...
 if it remains no message shows, so It creates confusion for users that
 click the save button and nothing happens because the validation fails...
 and the widget is not saved... I suggest to remove this function so the
 notification will show (as in the screenshot) ...

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


More information about the wp-trac mailing list