Use arrow keys to go to next ang in SGGS
sartaj10 opened this issue · comments
Hi,
Is it currently possible to switch between Angs in SGGS using the arrow keys?
Maybe, it could be a feature that can be added
Thank you so much for raising this issue, feel free to contribute for the same!
Ang state is stored in src/pages/SGGS/index.js.
You can addEventListener in componentDidMount
for keyup
to set call handleIncrementAng
or handleDecrementAng
based on arrow key pressed. You can get keycodes for arrow keys here.
Don't forget to removeEventListener in componentWillUnmount
lifecycle method of above component to be conservative of memory leaks.
We might also want to debounce the event listener to avoid multiple API calls.
You can also join our slack channel to contribute more!
Thanks! I'll work on the same and add in a PR soon.
Also, joined the slack channel 👍