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

Question - Is there a way to disable the context menu #12

Closed
mattbrannon opened this issue Mar 20, 2022 · 2 comments
Closed

Question - Is there a way to disable the context menu #12

mattbrannon opened this issue Mar 20, 2022 · 2 comments
Labels
question Further information is requested

Comments

@mattbrannon
Copy link

I was tabbing through my site checking which elements received focus and I was surprised to find that MathJax equations are focusable. Once focused, clicking the spacebar brings up a MathJax context menu. Is there a way to disable this behavior? I was able to remove the outline with css but the element is still focusable which isn't ideal.

@fast-reflexes
Copy link
Owner

fast-reflexes commented Mar 21, 2022

Hello there!

This question is actually a MathJax question but I'll answer it anyways :)

You can disable the menu by the following configuration options in versions 2 and 3:

// version 2
const mj2config = {
  showMathMenu: false
};
// version 3
const mj3config = {
  options: {
    enableMenu: false
  }
};

To remove the math from tabbing, use the following configurations (which may of course be combined with the above):

// version 2
const mj2config = {
  menuSettings: { inTabOrder: false },
};
// version 3
const mj3config = {
  options: {
    menuOptions: {
      settings: {
        inTabOrder: false
      }
    }
  }
};

NOTE however, that in MathJax 2 this works flawlessly and you can have an enabled menu and remove all math from tabbing and vice versa. In MathJax 3, the menuOptions seems to be entirely ignored (which I have filed a report about here: mathjax/MathJax#2855), but if you disable the menu, the math is ALSO removed from tabbing so in your case, I don't think it matters since you don't seem to be interested in the menu.

You can read more about similar options here:

MathJax version 2: https://docs.mathjax.org/en/v2.7-latest/options/hub.html

MathJax version 3: https://docs.mathjax.org/en/latest/options/menu.html

@fast-reflexes fast-reflexes added the question Further information is requested label Mar 21, 2022
@fast-reflexes
Copy link
Owner

Apparently there was a bug in MathJax 3.2.0 that causes this but it will be fixed in 3.2.1. Nonetheless, deactivating tabbing but keeping the menu will not be allowed so probably it will just be better documented but not possible. In the MathJax community, a lot of people see it as poor design to turn off these assistive technologies... I've done it myself a few times but they have put a lot of effort into making the page accessible to users who need assistance so ... yeah, just something worth to think about :)

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

No branches or pull requests

2 participants