Cannot exclude mathlive fields from tab keyboard navigation (tabindex=-1)
See original GitHub issueDescription
Mathlive textfields appear to disregard the html tabindex
attribute.
Attempts to exclude certain Mathlive textfields from tabbing navigation with tabindex=-1
fail.
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
- Go to https://mathlive.io/
- Open Developer Tools
- Click into the mathlive textfield
- Tab and Shift+Tab to make sure you’re on the element focussed by tabbing
- Type
document.activeElement
in the Development Console to get the node focussed by tabbing - Set
tabindex="-1"
for that html element. - 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.
- Go to https://mathlive.io/
- Open Developer Tools
- Click on background
- Use Shift+Tab
- Type
document.activeElement
in the Development Console to get the node focussed by tabbing (should be <button id="code-section-button">) - Set
tabindex="-1"
for that html element. - Repeating 3. 4. and 5. should now show you that the
Switch Theme
element is focussed, henceShow code section
button is correctly skipped
Environment
Operating System Windows
Browser Chrome
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now working correctly when using web component, i.e. the
<math-field>
tag.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.