Skip to content

Commit

Permalink
FIXED: Issue 25 - Can't use left & right arrow keys in cell editors
Browse files Browse the repository at this point in the history
Sample text cell editors now control which keys should not be propagated.
  • Loading branch information
mleibman committed May 18, 2010
1 parent 41006c1 commit 64b2fc0
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion slick.editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ var SlickEditor = {
}

$input.appendTo($container);

$input.bind("keydown.nav", function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
});

$input.focus().select();
};

Expand Down Expand Up @@ -133,6 +140,12 @@ var SlickEditor = {
$input.val(defaultValue);
}

$input.bind("keydown.nav", function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
});

$input.appendTo($container);
$input.focus().select();
};
Expand Down Expand Up @@ -176,7 +189,6 @@ var SlickEditor = {
this.init();
},


DateCellEditor : function($container, columnDef, value, dataContext) {
var $input;
var defaultValue = value;
Expand Down Expand Up @@ -434,6 +446,11 @@ var SlickEditor = {
$input.val(defaultValue);
}

$input.bind("keydown.nav", function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
});
$input.appendTo($container);
$input.focus().select();
};
Expand Down Expand Up @@ -500,6 +517,11 @@ var SlickEditor = {
$input.val(defaultValue.join(", "));
}

$input.bind("keydown.nav", function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
});
$input.appendTo($container);
$input.focus().select();
};
Expand Down

0 comments on commit 64b2fc0

Please sign in to comment.