Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[Windows] F10 opens Menu instead of "Stepping Over" #1367

Closed
jnachtigall opened this issue Dec 1, 2016 · 2 comments
Closed

[Windows] F10 opens Menu instead of "Stepping Over" #1367

jnachtigall opened this issue Dec 1, 2016 · 2 comments

Comments

@jnachtigall
Copy link
Contributor

jnachtigall commented Dec 1, 2016

If you press F10 under Windows 7 and 10, then the Firefox Menu opens. In order to step over an instruction I have to use the mouse instead of the F10 shortcut.

This was also an issue in the old debugger, see https://bugzilla.mozilla.org/show_bug.cgi?id=923971 (uh, I just see that yesterday someone asked to reopen it)

@jasonLaster
Copy link
Contributor

Thanks for sharing.

@jnachtigall would you like to try and submit a fix?

I think the patch would look something like this?

I don't have a windows computer, so it is tough for me to asses.

Here's our getting started guide, it should be ~ 5 mins.

diff --git a/src/components/CommandBar.js b/src/components/CommandBar.js
index 22d4663..dcba347 100644
--- a/src/components/CommandBar.js
+++ b/src/components/CommandBar.js
@@ -53,15 +53,20 @@ const CommandBar = React.createClass({

   componentWillUnmount() {
     const shortcuts = this.context.shortcuts;
-    shortcuts.off("F8", this.props.resume);
-    shortcuts.off("F10", this.props.stepOver);
-    shortcuts.off(`${ctrlKey}F11`, this.props.stepIn);
-    shortcuts.off(`${ctrlKey}Shift+F11`, this.props.stepOut);
+    shortcuts.off("F8");
+    shortcuts.off("F10");
+    shortcuts.off(`${ctrlKey}F11`);
+    shortcuts.off(`${ctrlKey}Shift+F11`);
   },

   componentDidMount() {
     const shortcuts = this.context.shortcuts;
-    shortcuts.on("F8", this.props.resume);
+    shortcuts.on("F8", (_, e) => {
+      e.stopPropogation();
+      this.props.resume();
+    });
+
+    // repeat for other handlers
     shortcuts.on("F10", this.props.stepOver);
     shortcuts.on(`${ctrlKey}F11`, this.props.stepIn);
     shortcuts.on(`${ctrlKey}Shift+F11`, this.props.stepOut);

@clarkbw clarkbw self-assigned this Dec 2, 2016
jasonLaster added a commit that referenced this issue Dec 16, 2016
* handle the function keys by preventing the default action

* need to check this on Windows later, working again on Mac

* tweak
@jasonLaster
Copy link
Contributor

Fixed in #1455

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

No branches or pull requests

3 participants