Opened 10 years ago
Closed 10 years ago
#13304 closed bug (notabug)
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: |
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.
Note: See
TracTickets for help on using
tickets.
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.