Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 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();
}
}
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);
}
}
onInputKeyDown(event) {
if (isKey(event.keyCode, 'ENTER')) {
this.runLocalHooks('accept');
stopImmediatePropagation(event);
} else if (isKey(event.keyCode, 'ESCAPE')) {
this.runLocalHooks('cancel');
stopImmediatePropagation(event);
}
}
}
value: function onInputKeyDown(event) {
if (isKey(event.keyCode, 'ENTER')) {
this.runLocalHooks('accept');
stopImmediatePropagation(event);
} else if (isKey(event.keyCode, 'ESCAPE')) {
this.runLocalHooks('cancel');
stopImmediatePropagation(event);
}
}
}]);
onInputKeyDown(event) {
if (isKey(event.keyCode, 'ENTER')) {
this.runLocalHooks('accept');
stopImmediatePropagation(event);
} else if (isKey(event.keyCode, 'ESCAPE')) {
this.runLocalHooks('cancel');
stopImmediatePropagation(event);
}
}
}
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);
}
}