Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use arrow keys to go to next ang in SGGS #132

Open
sartaj10 opened this issue May 1, 2018 · 2 comments
Open

Use arrow keys to go to next ang in SGGS #132

sartaj10 opened this issue May 1, 2018 · 2 comments

Comments

@sartaj10
Copy link

sartaj10 commented May 1, 2018

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

@bogas04
Copy link
Owner

bogas04 commented May 2, 2018

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!

@sartaj10
Copy link
Author

sartaj10 commented May 2, 2018

Thanks! I'll work on the same and add in a PR soon.

Also, joined the slack channel 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants