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

Make static math focusable #303

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

eluberoff
Copy link
Member

@eluberoff eluberoff commented Sep 15, 2024

Note: as Jared noticed, this isn't backwards compatible if people are using substituteTextareas for StaticMath and don't pay attention to the tabbable property.

@eluberoff eluberoff force-pushed the make-focus-and-select-actually-work branch from 412c028 to c290aa4 Compare September 15, 2024 18:52
For StaticMath, this defaults to "false"
For MathField, this defaults to "true"

This also adds a "focus" method to StaticMath, which
automatically selects the contents
@eluberoff eluberoff force-pushed the make-focus-and-select-actually-work branch from c290aa4 to 7628c5a Compare September 15, 2024 19:00
@jared-hughes
Copy link

For clarification of the backwards-incompatibility: An existing substituteTextarea implementation is always tabbable, while the mathquill API after this PR expects substituteTextarea to give a non-tabbable textarea when passed tabbable: false.

src/services/focusBlur.ts Show resolved Hide resolved
test/unit/aria.test.js Show resolved Hide resolved
test/unit/focusBlur.test.js Outdated Show resolved Hide resolved
@jared-hughes
Copy link

I'll add some documentation for the new substituteTextarea signature.

@jared-hughes jared-hughes self-requested a review September 17, 2024 01:27
Copy link

@jared-hughes jared-hughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Only issue is the slight backwards-compatability issue, but that isn't really a problem. A permanent textarea is much easier to reason about than one that gets removed and added.

@eluberoff eluberoff merged commit ed74955 into main Sep 17, 2024
5 checks passed
@eluberoff eluberoff deleted the make-focus-and-select-actually-work branch September 17, 2024 01:36
@eluberoff eluberoff changed the title Proof of concept: another approach to making static math focusable Make static math focusable Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants