MCPcopy
hub / github.com/negomi/react-burger-menu / onKeyDownClosed

Function onKeyDownClosed

lib/menuFactory.js:351–367  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

349 }
350
351 function onKeyDownClosed(e) {
352 e = e || window.event;
353 // Key downs came from menu button
354 if (e.target === document.getElementById('react-burger-menu-btn')) {
355 switch (e.key) {
356 case ARROW_DOWN:
357 case SPACE:
358 // If down arrow, space or enter, open menu and focus on first menuitem
359 toggleMenu();
360 break;
361 case ARROW_UP:
362 // If arrow up, open menu and focus on last menuitem
363 toggleMenu({ focusOnLastItem: true });
364 break;
365 }
366 }
367 }
368
369 function handleOverlayClick() {
370 if (props.disableOverlayClick === true || typeof props.disableOverlayClick === 'function' && props.disableOverlayClick()) {

Callers

nothing calls this directly

Calls 1

toggleMenuFunction · 0.70

Tested by

no test coverage detected