Skip to content

[v4.1.0] No supported way to disable math focus/selection while preserving embedded input controls (regression from v3.2.2 & 2.7.4) #3491

@sobhanadrink

Description

@sobhanadrink

Is your feature request related to a problem? Please describe.
In MathJax v4.1.0, rendered math becomes focusable and selectable when clicked or when navigating via the Tab key. This activates MathJax Explorer, selection highlighting, and focus behavior by default.

In interactive applications where MathJax output includes embedded HTML form controls (for example elements rendered inside math using custom markup or extensions), this behavior causes usability issues:

  • Clicking inside the math activates MathJax selection instead of the intended UI control
  • Math containers receive focus during tab navigation even when they should be read-only
  • Embedded input fields cannot be interacted with reliably because the parent MathJax container captures focus and selection
  • There is no supported configuration option to disable this behavior selectively

This issue does not occur in MathJax v3.2.2 or earlier versions, where embedded input controls inside math could be interacted with without triggering math selection or focus. The behavior appears to be a regression or a behavioral change introduced in MathJax v4.

Describe the solution you'd like
Provide a supported configuration option to restrict or disable MathJax focus/selection behavior on rendered math containers, while still allowing normal interaction with embedded HTML controls.
Possible configuration ideas (illustrative only):

options: {
  selectable: false,
}

The key requirement is to prevent math containers from capturing focus or selection without blocking interaction on child elements.

Describe alternatives you've considered
The following alternatives were tested but are not viable:

  • inTabOrder: false (Removes tab focus but does not prevent mouse focus or selection)

Additional context
This issue occurs in interactive applications such as educational platforms, assessments, and math editors where MathJax is used as a visual rendering layer combined with live form inputs.

Attached files include:

  • A minimal HTML reproduction file
  • A short video demonstrating the issue
  • A screenshot highlighting math focus/selection behavior

Expected behavior: Clicking inside the text box allows typing without activating math selection.
Actual behavior: MathJax container captures focus/selection and interferes with input interaction.

A supported configuration-level solution would avoid fragile DOM hacks and preserve both usability and accessibility.

Mathjax-4.1.0-math-selecton.html
https://github.com/user-attachments/assets/2d507417-bc3d-48d4-8948-be7b3600ac6a

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedIssue has been reproduced by MathJax teamCode ExampleContains an illustrative code example, solution, or work-aroundv4

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions