handle the function keys by preventing the default action, fixes #1367 #1373
Conversation
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.
Can we avoid stop propagation as we're listening on the window? Not much higher to go!
Also I wonder if you could add a helper
stopPropogation(() => this.stepIn())
Sorry, typing on the go.
I tried this but I believe if you don't stop propagation the event is bubbled out of the window context because this is a key the browser / OS handles. I tried using just one or the other and it required both to be used in order to stop the default action from happening.
Sounds like a good plan. Will update soon. |
shortcuts.on(`${ctrlKey}Shift+F11`, this.props.stepOut); | ||
const handleEvent = (e, func) => { | ||
e.preventDefault(); | ||
if (e.stopPropogation) { |
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.
strange, i've never seen this stopPropogation
not present. What case are you handling here?
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 was seeing an error in the console complaining that stopPropogation
didn't exist while working on my Mac and I wasn't see on Windows. I'll be able to check it out on both this week some time. Not sure what's really going on here.
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.
hmm, i can take a look
I dropped the https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation |
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.
👍
closing this in favor of #1455 |
Associated Issue: #1367
Summary of Changes
preventDefault
andstopPropogation
Test Plan (tested in Windows only)