From 32c7951d5e5db2dfde5305707e4d9bf021952db2 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Tue, 20 Mar 2018 15:23:02 +0100 Subject: Properly support keyboard navigation for the menu --- src/client/react/components/container/Menu.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/client/react/components/container/Menu.js b/src/client/react/components/container/Menu.js index 36367ed..f99ed37 100644 --- a/src/client/react/components/container/Menu.js +++ b/src/client/react/components/container/Menu.js @@ -30,16 +30,30 @@ class Menu extends React.Component { dispatch: PropTypes.func.isRequired, } + onItemSelected(index) { + switch (index) { + case 'room_finder': + this.props.dispatch({ type: 'ROOM_FINDER/SHOW' }); + break; + default: + // No default + } + } + render() { return ( } + onSelected={(event) => { + // Send the `data-type` of the selected + this.onItemSelected(event.detail.item.dataset.type); + }} > - Voeg label toe - Maak favoriet + Voeg label toe + Maak favoriet
- this.props.dispatch({ type: 'ROOM_FINDER/SHOW' })}>Lokaal zoeken - Oud rooster gebruiken + Lokaal zoeken + Oud rooster gebruiken ); } -- cgit v1.1