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 |
raclim
left a comment
There was a problem hiding this comment.
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
Escapekey handling into the newModalcomponent.Changes:
useKeyDownHandlersfor adding one or more keydown handlers to thedocument, and componentDocumentKeyDownwhich wraps the hook for use in class components.Nav,Overlay, andModalIDEViewinto new hook/componentuseIDEKeyHandlers/IDEKeyHandlers, which accesses redux props directly and allows a few props to be removed fromIDEView.MobileIDEViewinstead of repeating it.I have verified that this pull request:
npm run lint)npm run test)developbranch.Fixes #123