Community
Participate
Working Groups
// [rst] Catch backspace in readonly text fields to prevent browser default
// action (which commonly triggers a history step back)
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178320
this.addEventListener("keydown", this._onkeydown);
this.addEventListener( "keydown", this._onkeydown );
// [if] Catch arrow keys in enabled text fields to prevent their propagation to the parent
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=335779
this.addEventListener( "keypress", this._onkeypress );
},
}
_onkeypress : function( e ) {
if( ( e.getKeyIdentifier() == "Left"
|| e.getKeyIdentifier() == "Right"
|| e.getKeyIdentifier() == "Up"
|| e.getKeyIdentifier() == "Down" )
&& this.getEnabled() ) {
e.stopPropagation();
/*
---------------------------------------------------------------------------
CROSS-BROWSER SELECTION HANDLING