Bug Tracker

Modify

Ticket #12739 (closed bug: fixed)

Opened 18 months ago

Last modified 18 months ago

Name: Passing in an Event to trigger strips namespace

Reported by: cobrajs Owned by: cobrajs
Priority: low Milestone: 1.9
Component: event Version: git
Keywords: Cc:
Blocking: Blocked by:

Description

jQuery Version: Git, 1.8.2, 1.7.2

Browser: Firefox 10, 16

OS: Windows XP, Linux

Test Case:  http://jsfiddle.net/PbBcm/1/

When you trigger an event event with a namespace using a jQuery.Event (either from generating it, or receiving it from bind function), the namespace is ignored and all events of that type are triggered instead of just the one referenced in the original namespace.

For example, in the test case, it is triggering a "foo.bar" event, and passing that event on to its child divs. When the event is passed to trigger, it triggers all "foo.*" events, so "foo.bar" and "foo.bar2" get called.

This is reproducible in every version of jQuery, because I looked at the code in git and it is still like this.

Change History

comment:1 Changed 18 months ago by Allen Schmidt <cobrasoft@…>

comment:2 Changed 18 months ago by elgreg

  • Owner set to cobrajs
  • Status changed from new to pending

Marking as pending. Waiting for test cases per github pull request conversation  https://github.com/jquery/jquery/pull/972

comment:3 Changed 18 months ago by Allen J Schmidt Jr

  • Status changed from pending to closed
  • Resolution set to fixed

Fix #12739. Keep namespace when triggering with an Event. Close gh-972.

Changeset: c6cf30a56e29c7f8e009443611f86a4c0839b689

comment:4 Changed 18 months ago by dmethvin

  • Priority changed from undecided to low
  • Component changed from unfiled to event
  • Milestone changed from None to 1.9

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.