Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`on ENTER keyup`, () => {
const e = angular.element.Event('keyup'); // eslint-disable-line new-cap
e.keyCode = keyCodes.ENTER;
element.trigger(e);
sinon.assert.calledOnce(scope.handleClick);
});
it(`on ENTER keyup`, () => {
const e = angular.element.Event('keyup'); // eslint-disable-line new-cap
e.keyCode = keyCodes.ENTER;
element.trigger(e);
sinon.assert.calledOnce(scope.handleClick);
});
onFieldKeyDown = ({ keyCode }) => {
if (keyCode === keyCodes.ENTER) {
this.saveEdit();
}
if (keyCode === keyCodes.ESCAPE) {
this.cancelEdit();
}
}
onFieldKeyDown = ({ keyCode }) => {
if (keyCode === keyCodes.ENTER) {
this.saveEdit();
}
if (keyCode === keyCodes.ESCAPE) {
this.cancelEdit();
}
}
newGroupKeyPress = (e) => {
if (
e.keyCode === keyCodes.ENTER &&
this.state.groupsValidationError === '' &&
this.state.tempNewGroupName !== ''
) {
this.addNewGroup();
}
};
onEditFieldKeyDown = ({ keyCode }) => {
if (keyCodes.ENTER === keyCode) {
this.props.saveFilter({
filterId: this.state.editingFilterId,
newFilterValue: this.state.editingFilterValue,
});
this.stopEditingFilter();
}
if (keyCodes.ESCAPE === keyCode) {
this.stopEditingFilter();
}
};
$scope.submitEditorWithKeyboard = (event) => {
if (event.ctrlKey && event.keyCode === keyCodes.ENTER) {
event.preventDefault();
event.stopPropagation();
$scope.stageEditableVis();
}
};
this.onKeyDown = (ev) => {
if (ev.keyCode === keyCodes.ENTER) {
this.restore();
return;
}
if (ev.keyCode === keyCodes.UP) {
ev.preventDefault();
this.selectedIndex--;
} else if (ev.keyCode === keyCodes.DOWN) {
ev.preventDefault();
this.selectedIndex++;
}
this.selectedIndex = Math.min(Math.max(0, this.selectedIndex), this.reqs.length - 1);
this.selectedReq = this.reqs[this.selectedIndex];
this.viewingReq = this.reqs[this.selectedIndex];
};
hint.keydown(ev => {
if (ev.keyCode === keyCodes.ENTER) {
ev.preventDefault();
startEditing();
}
});
function onKeyDown(event: KeyboardEvent) {
if (event.keyCode === keyCodes.ENTER) {
onClose();
}
}