Skip to main content

Bug Tracker

Side navigation

#14028 closed bug (notabug)

Opened June 16, 2013 10:04AM UTC

Closed June 23, 2013 03:40PM UTC

delegate event

Reported by: deng.hui5@gmail.com 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?

Attachments (0)
Change History (4)

Changed June 16, 2013 10:07AM UTC by deng.hui5@gmail.com comment:1

sorry for bad format. A/B/C means:

A is parent of B, B is parent of C, C has chlildren

Changed June 16, 2013 10:11AM UTC by deng.hui5@gmail.com comment:2

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

Changed June 16, 2013 11:16AM UTC by deng.hui5@gmail.com comment:3

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

Changed June 23, 2013 03:40PM UTC by dmethvin comment:4

resolution: → notabug
status: newclosed

Please ask for help on a forum.