Skip to main content

Bug Tracker

Side navigation

#13304 closed bug (notabug)

Opened January 22, 2013 08:03PM UTC

Closed January 22, 2013 08:22PM UTC

Don't call Element remove for custom remove event

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

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.

Attachments (0)
Change History (1)

Changed January 22, 2013 08:22PM UTC by dmethvin comment:1

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.