Skip to Content | Skip to Navigation


dojo/_base/event

dojo/_base/event contains the legacy API for managing DOM events and is deprecated. For handling DOM events, you should use dojo/on instead.

Usage

As with the rest of dojo/_base modules, if you are running the Dojo loader in legacy mode (async: false) this module is automatically loaded. Even if it is automatically loaded, you should require it in to have access to its features:

require(["dojo/_base/event"], function(event){
  // event now contains the modules features
});

Features

stop()

prevents propagation and clobbers the default action of the passed event

NameTypeDescription
evtEvent

The event object. If omitted, window.event is used on IE.

fix()

normalizes properties on the event object including event bubbling methods, keystroke normalization, and x/y positions

NameTypeDescription
evtEvent

native event object

senderDOMNode

node to treat as "currentTarget"

Note: fix() also invokes dojo/dom-geometry::normalizeEvent() in addition to normal event fixing that is performaned by dojo/on. This is because it is expensive and can be handled directly if needed.

See also