Bug Tracker

Opened 10 years ago

Closed 10 years ago

#14028 closed bug (notabug)

delegate event

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

considering DOM such as A

B C

and code: element.delegate(":not(C *)","click",dosomething); if click inside C, this statement will trigger click event but that is not we want. read source code I found in "Find delegate handlers" will bubble from inside C until A, so when trying until B it will be matched and apply dosomething hanler. is it a bug?

Change History (4)

comment:1 Changed 10 years ago by [email protected]

sorry for bad format. A/B/C means: A is parent of B, B is parent of C, C has chlildren

comment:2 Changed 10 years ago by [email protected]

additionally, if C has many ancestors until B, dosomething will be triggered as many times

comment:3 Changed 10 years ago by [email protected]

why handlers function iterate ancestor nodes of event target? I assume only test selector on event target is enough.

comment:4 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

Please ask for help on a forum.

Note: See TracTickets for help on using tickets.