DomEvent class

Annotations
  • @JS('L.DomEvent')

Constructors

DomEvent()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

disableClickPropagation(Element el) → void
Adds stopPropagation to the element's 'click', 'doubleclick', 'mousedown' and 'touchstart' events (plus browser variants).
disableScrollPropagation(Element el) → void
Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
getMousePosition(Event e, [Element? container]) Point
Gets normalized mouse position from a DOM event relative to the container (border excluded) or to the whole page if not specified.
getWheelDelta(Event e) num
Gets normalized wheel delta from a mousewheel DOM event, in vertical pixels scrolled (negative if scrolling down). Events from pointing devices without precise scrolling are mapped to a best guess of 60 pixels.
off(Element el, String types, Function fn, [dynamic context]) → void
Removes a previously added listener function. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
on(Element el, String types, Function fn, [dynamic context]) → void
Adds a listener function (fn) to a particular DOM event type of the element el. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
preventDefault(Event e) → void
Prevents the default action of the DOM Event e from happening (such as following a link in the href of the a element, or doing a POST request with page reload when a <form> is submitted). Use it inside listener functions.
stop(Event e) → void
Does stopPropagation and preventDefault at the same time.
stopPropagation(Event e) → void
Stop the given event from propagation to parent elements.