Skip to content

Commit

Permalink
Prevent KeyboardDefaults.js from triggering keyboard events when user…
Browse files Browse the repository at this point in the history
… is typing into the form elements
  • Loading branch information
temporaryaccount committed Jul 19, 2012
1 parent 99553d0 commit 950904f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/OpenLayers/Control/KeyboardDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
*/
defaultKeyPress: function (evt) {
var size, handled = true;

if((typeof evt.target) != 'undefined' &&
(evt.target.tagName == 'INPUT' ||
evt.target.tagName == 'TEXTAREA' ||
evt.target.tagName == 'SELECT')) {
return;
}

switch(evt.keyCode) {
case OpenLayers.Event.KEY_LEFT:
this.map.pan(-this.slideFactor, 0);
Expand Down

0 comments on commit 950904f

Please sign in to comment.