-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move keydown handling out of IDEView #2052
Conversation
# Conflicts: # client/modules/IDE/pages/IDEView.jsx
# Conflicts: # client/modules/IDE/pages/IDEView.jsx
This looks great for me so far! I think the only issue I've noticed is that the sketch will still run despite using the Keyboard shortcut |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found the source of my issue with stopping the sketch, which was in lines 34-38 in the useKeyDownHandlers.js
file. Within those lines, I think the order in which the handlers were being called might not be consistent across different browsers/devices, which is why my sketch would restart again. I updated the check to use an else if
statement, and also removed a few linting warnings and errors.
I'm sorry again that this took a while to review and thank you for making these really awesome changes!
@raclim I need to put in a quick bug fix because apparently |
@lindapaiste, sounds good, thanks for catching this and giving a heads up! |
Progress on #1458 and #824
Should be merged after #2049 as I moved the
Escape
key handling into the newModal
component.Changes:
useKeyDownHandlers
for adding one or more keydown handlers to thedocument
, and componentDocumentKeyDown
which wraps the hook for use in class components.Nav
,Overlay
, andModal
IDEView
into new hook/componentuseIDEKeyHandlers
/IDEKeyHandlers
, which accesses redux props directly and allows a few props to be removed fromIDEView
.MobileIDEView
instead of repeating it.I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123