question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot exclude mathlive fields from tab keyboard navigation (tabindex=-1)

See original GitHub issue

Description

Mathlive textfields appear to disregard the html tabindex attribute.

Attempts to exclude certain Mathlive textfields from tabbing navigation with tabindex=-1 fail.

image

Actual behavior

When setting tabindex=-1 or tabindex=100, the mathlive textfield remains in the same place of the tab navigation.

Expected Behavior

When setting tabindex=-1, the mathlive textfield is skipped in tab navigation.

Steps to Reproduce

  1. Go to https://mathlive.io/
  2. Open Developer Tools
  3. Click into the mathlive textfield
  4. Tab and Shift+Tab to make sure you’re on the element focussed by tabbing
  5. Type document.activeElement in the Development Console to get the node focussed by tabbing
  6. Set tabindex="-1" for that html element.
  7. Repeat 3. and 4. to see if the mathlive textfield can still be focussed by tabbing

To verify that this process works correctly for other html elements (e.g. buttons), you can try the same procedure for the Show code section interface element in the sidebar.

  1. Go to https://mathlive.io/
  2. Open Developer Tools
  3. Click on background
  4. Use Shift+Tab
  5. Type document.activeElement in the Development Console to get the node focussed by tabbing (should be <button id="code-section-button">)
  6. Set tabindex="-1" for that html element.
  7. Repeating 3. 4. and 5. should now show you that the Switch Theme element is focussed, hence Show code section button is correctly skipped

Environment

Operating System Windows

Browser Chrome

URL https://mathlive.io/

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
arnogcommented, Oct 11, 2020

This is now working correctly when using web component, i.e. the <math-field> tag.

1reaction
stefnotchcommented, Oct 4, 2020

That would break internet explorer compatibility, but I think that’s fine at this point. (Even Microsoft is starting to drop support for it.) Another thing that could be done when breaking IE compatibility is to stop shipping the .woff fonts and only ship the more modern .woff2 fonts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tabindex - HTML: HyperText Markup Language | MDN
The user won't be able to focus any element with a negative tabindex using the keyboard, but a script can do so by...
Read more >
How to ignore HTML element from tabindex? - Stack Overflow
The user agent must set the element's tabindex focus flag, but should not allow the element to be reached using sequential focus navigation....
Read more >
MathLive - CortexJS
Return true if the mathfield is currently focused (responds to keyboard input). ... The user is navigating out of the mathfield, typically using...
Read more >
Keyboard Accessibility - Tabindex - WebAIM
It can ensure that only one element within a widget, such as the active tab within a group of interactive tabs for a...
Read more >
Control focus with tabindex - web.dev
Try pressing the Tab key to navigate through your site. ... <button tabindex="-1">Can't reach me with the TAB key!</button>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found