Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13304 closed bug (notabug)

Don't call Element remove for custom remove event

Reported by: arv@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:

Description

If you fire a custom event called "remove" HTMLElement.prototype.remove gets called which removes the DOM element.

You should probably use a whitelist (click, focus, blur etc) instead of checking for the presence of the property.

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

It's documented that firing an event on an element calls its same-named method, and that .triggerHandler doesn't call it. If you're truly firing a *custom* event and don't want DOM semantics it shouldn't use a DOM method name.

Note: See TracTickets for help on using tickets.