Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13867 closed feature (wontfix)

Return jquery.Event for chaining

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version:
Keywords: Cc:
Blocked by: Blocking:

Description

I think it would be nice for e.stopPropagation, e.stopImmediatePropagation and e.preventDefault to return the jQuery event object for chaining, I have checked and they currently do not return, so a return this statement should do the job. Then I can call:

e.preventDefault().stopPropagation();

Change History (3)

comment:2 Changed 7 years ago by Rick Waldron

Resolution: wontfix
Status: newclosed

Thanks but jQuery is not accepting new features at this time.

comment:3 Changed 7 years ago by dmethvin

See the standard, those methods are void: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface

Changing our event to do something different than the standard would be a really bad idea. There could be times in the future when we want to pass a native unnormalized event and adopting these semantics would prevent i

Note: See TracTickets for help on using tickets.