Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value: function onItemsBoxBeforeKeyDown(event) {
var isKeyCode = partial(isKey, event.keyCode);
if (isKeyCode('ESCAPE')) {
this.runLocalHooks('keydown', event, this);
}
// for keys different than below, unfocus Handsontable and focus search input
if (!isKeyCode('ARROW_UP|ARROW_DOWN|ARROW_LEFT|ARROW_RIGHT|TAB|SPACE|ENTER')) {
stopImmediatePropagation(event);
this.itemsBox.unlisten();
this.itemsBox.deselectCell();
this.searchInput.focus();
}
}
onItemsBoxBeforeKeyDown(event) {
const isKeyCode = partial(isKey, event.keyCode);
if (isKeyCode('ESCAPE')) {
this.runLocalHooks('keydown', event, this);
}
// for keys different than below, unfocus Handsontable and focus search input
if (!isKeyCode('ARROW_UP|ARROW_DOWN|ARROW_LEFT|ARROW_RIGHT|TAB|SPACE|ENTER')) {
stopImmediatePropagation(event);
this.itemsBox.unlisten();
this.itemsBox.deselectCell();
this.searchInput.focus();
}
}
value: function onInputKeyDown(event) {
this.runLocalHooks('keydown', event, this);
var isKeyCode = partial(isKey, event.keyCode);
if (isKeyCode('ARROW_DOWN|TAB') && !this.itemsBox.isListening()) {
stopImmediatePropagation(event);
this.itemsBox.listen();
this.itemsBox.selectCell(0, 0);
}
}
onInputKeyDown(event) {
this.runLocalHooks('keydown', event, this);
const isKeyCode = partial(isKey, event.keyCode);
if (isKeyCode('ARROW_DOWN|TAB') && !this.itemsBox.isListening()) {
stopImmediatePropagation(event);
this.itemsBox.listen();
this.itemsBox.selectCell(0, 0);
}
}