MCPcopy Index your code
hub / github.com/adobe/react-spectrum / onKeyDown

Method onKeyDown

packages/react-aria/src/dnd/DragManager.ts:228–247  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

226 }
227
228 onKeyDown(e: KeyboardEvent): void {
229 this.cancelEvent(e);
230
231 if (e.key === 'Escape') {
232 this.cancel();
233 return;
234 }
235
236 if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
237 if (e.shiftKey) {
238 this.previous();
239 } else {
240 this.next();
241 }
242 }
243
244 if (typeof this.currentDropTarget?.onKeyDown === 'function') {
245 this.currentDropTarget.onKeyDown(e, this.dragTarget);
246 }
247 }
248
249 onKeyUp(e: KeyboardEvent): void {
250 this.cancelEvent(e);

Callers 12

useTableColumnResizeFunction · 0.80
useMenuFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80
onKeyDownFunction · 0.80

Calls 4

cancelEventMethod · 0.95
cancelMethod · 0.95
previousMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected