[wp-trac] [WordPress Trac] #18590: Swap out "return false" JS calls for preventDefault

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 5 17:11:04 UTC 2011


#18590: Swap out "return false" JS calls for preventDefault
----------------------------+------------------------------
 Reporter:  Viper007Bond    |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |
----------------------------+------------------------------

Comment (by azaozz):

 The linked article explains this well (although in quite a few words):
 "Only use return false when you want both preventDefault() and
 stopPropagation()".

 We are (should be) using `return false` to do both which is usually the
 case. Note that this doesn't stop the 'immediate propagation', i.e. if
 there are several 'click' handlers on the same element they all fire.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18590#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list