Dart API Referencedart:htmlEvent

Event Interface

This chapter describes the DOM Event Model. The Event interface itself is described, as well as the interfaces for event registration on nodes in the DOM, and event listeners, and several longer examples that show how the various event interfaces relate to one another.

There is an excellent diagram that clearly explains the three phases of event flow through the DOM in the DOM Level 3 Events draft.

Subinterfaces

AnimationEvent, AudioProcessingEvent, BeforeLoadEvent, CloseEvent, CustomEvent, DeviceMotionEvent, DeviceOrientationEvent, ErrorEvent, HashChangeEvent, IDBVersionChangeEvent, MediaKeyEvent, MediaStreamEvent, MediaStreamTrackEvent, MessageEvent, MutationEvent, OfflineAudioCompletionEvent, OverflowEvent, PageTransitionEvent, PopStateEvent, ProgressEvent, SpeechInputEvent, SpeechRecognitionError, SpeechRecognitionEvent, StorageEvent, TrackEvent, TransitionEvent, UIEvent, WebGLContextEvent

Constructors

Code new Event(String type, [bool canBubble, bool cancelable]) #

Event(String type, [bool canBubble, bool cancelable]);

Static Fields

Code final int AT_TARGET #

static final int AT_TARGET = 2;

Code final int BLUR #

static final int BLUR = 8192;

Code final int BUBBLING_PHASE #

static final int BUBBLING_PHASE = 3;

Code final int CAPTURING_PHASE #

static final int CAPTURING_PHASE = 1;

Code final int CHANGE #

static final int CHANGE = 32768;

Code final int CLICK #

static final int CLICK = 64;

Code final int DBLCLICK #

static final int DBLCLICK = 128;

Code final int DRAGDROP #

static final int DRAGDROP = 2048;

Code final int FOCUS #

static final int FOCUS = 4096;

Code final int KEYDOWN #

static final int KEYDOWN = 256;

Code final int KEYPRESS #

static final int KEYPRESS = 1024;

Code final int KEYUP #

static final int KEYUP = 512;

Code final int MOUSEDOWN #

static final int MOUSEDOWN = 1;

Code final int MOUSEDRAG #

static final int MOUSEDRAG = 32;

Code final int MOUSEMOVE #

static final int MOUSEMOVE = 16;

Code final int MOUSEOUT #

static final int MOUSEOUT = 8;

Code final int MOUSEOVER #

static final int MOUSEOVER = 4;

Code final int MOUSEUP #

static final int MOUSEUP = 2;

Code final int NONE #

static final int NONE = 0;

Code final int SELECT #

static final int SELECT = 16384;

Methods

Code void preventDefault() #

Cancels the event (if it is cancelable).
void preventDefault();

Code void stopImmediatePropagation() #

For this particular event, no other listener will be called. Neither those attached on the same element, nor those attached on elements which will be traversed later (in capture phase, for instance)
void stopImmediatePropagation();

Code void stopPropagation() #

Stops the propagation of events further along in the DOM.
void stopPropagation();

Code void $dom_initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg) #

Initializes the value of an Event created through the DocumentEvent interface.
void $dom_initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg);

Fields

Code final bool bubbles #

A boolean indicating whether the event bubbles up through the DOM or not.
final bool bubbles;

Code bool cancelBubble #

A boolean indicating whether the bubbling of the event has been canceled or not.
bool cancelBubble;

Code final bool cancelable #

A boolean indicating whether the event is cancelable.
final bool cancelable;

Code final Clipboard clipboardData #

final Clipboard clipboardData;

Code final EventTarget currentTarget #

A reference to the currently registered target for the event.
final EventTarget currentTarget;

Code final bool defaultPrevented #

Indicates whether or not event.preventDefault() has been called on the event.
final bool defaultPrevented;

Code final int eventPhase #

Indicates which phase of the event flow is being processed.
final int eventPhase;

Code bool returnValue #

bool returnValue;

Code final EventTarget srcElement #

final EventTarget srcElement;

Code final EventTarget target #

A reference to the target to which the event was originally dispatched.
final EventTarget target;

Code final int timeStamp #

The time that the event was created.
final int timeStamp;

Code final String type #

The name of the event (case-insensitive).
final String type;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.