10 examples of 'onkeydown react' in JavaScript

Every line of 'onkeydown react' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
1287onKeyDown: function onKeyDown(event) {
1288 if (AFRAME.utils.shouldCaptureKeyEvent(event)) {
1289 this.localKeys[event.code] = true;
1290 this.emit(event);
1291 }
1292},
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

117onKeyDown: function onKeyDown(event) {
118 _this.onKeyDown(event, item);
119}
26onKeyDown(keyName: string, e: KeyboardEvent, handle: HotkeysEvent) {
27 console.log("test:onKeyDown", keyName, e, handle)
28 this.setState({
29 output: `onKeyDown ${keyName}`,
30 });
31}
33onKeyDown(e, handle) {
34 const { onKeyDown } = this.props;
35 if (this.isKeyDown) return;
36 this.isKeyDown = true;
37 this.handle = handle;
38 onKeyDown(handle.shortcut, e, handle);
39}
420onKeyDown(event) {
421 const keycode = event.keyCode || event.which;
422 if(keycode == 118 && event.ctrlKey) {
423 this.onSave();
424 }
425}
13onKeyDown(e, ...args) {
14 const {keyCode} = e;
15 const isDown = (keyCode === 40);
16 const isUp = (keyCode === 38);
17
18 if (isDown || isUp) {
19 e.preventDefault();
20 const nodeOfInterest = isUp ? 'previousElementSibling' : 'nextElementSibling';
21 const nextListItem = e.target.parentElement;
22 if (nextListItem && nextListItem[nodeOfInterest]) {
23 nextListItem[nodeOfInterest].firstChild.focus();
24 }
25 }
26 this.props.onKeyDown(e, ...args);
27}
418onKeyDown: function onKeyDown(event) {
419 event.keyCode === 13 && _this.onActivatePresetTag(tag);
420},
51value: function onKeyDown(event) {
52 if (event.keyCode == 13) {
53 this.props.onChange(this.state.value);
54 }
55}
100private onKeydown(evt: JQuery.Event) {
101 // On initial mouse click, form-control keydown event (from modal) may be bubbled up without key value set.
102 // The reason for !evt.key is unknown. We ignore event with falsy evt.key.
103 if (!evt.key || $(evt.target).is('input, textarea, *[contenteditable=true]')) {
104 return;
105 }
106 this.interactionKeydown(evt);
107}
85protected onKeyDown(e: KeyboardEvent) {
86 switch (e.keyCode) {
87 case 13: // enter
88 case 27: // esc
89 this.close();
90 break;
91 }
92}

Related snippets