dijit.form.Textarea._onKeyPress
dojo.require("dijit.form.Textarea");
defined in dijit/form/Textarea.js
Usage
function (e) (view source)
if(e.keyCode == dojo.keys.TAB && !e.shiftKey && !e.ctrlKey && !e.altKey && this.iframe){ // Pressing the tab key in the iframe (with designMode on) will cause the // entry of a tab character so we have to trap that here. Since we don't // know the next focusable object we put focus on the iframe and then the // user has to press tab again (which then does the expected thing). // A problem with that is that the screen reader user hears "edit area" // announced twice which causes confusion. By setting the // contentDocument's title to "edit area frame" the confusion should be // eliminated. this.iframe.contentDocument.title = this._iframeFocusTitle; // Place focus on the iframe. A subsequent tab or shift tab will put focus // on the correct control. // Note: Can't use this.focus() because that results in a call to // dijit.focus and if that receives an iframe target it will set focus // on the iframe's contentWindow. this.iframe.focus(); // this.focus(); won't work dojo.stopEvent(e); }else if(e.keyCode == dojo.keys.ENTER){ e.stopPropagation(); }else if(this.inherited("_onKeyPress", arguments) && this.iframe){ // #3752: // The key press will not make it past the iframe. // If a widget is listening outside of the iframe, (like InlineEditBox) // it will not hear anything. // Create an equivalent event so everyone else knows what is going on. var te = dojo.doc.createEvent("KeyEvents"); te.initKeyEvent("keypress", true, true, null, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.keyCode, e.charCode); this.iframe.dispatchEvent(te); } this._changing();
parameter | type | description |
---|---|---|
e |