Documentation
dojo/_base/event¶
Contents
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
Name | Type | Description |
---|---|---|
evt | Event | 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
Name | Type | Description |
---|---|---|
evt | Event | native event object |
sender | DOMNode | 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.