Repository navigation
Keep the device's keyboard when a viewer has no virtual keyboard - #2287
Merged
dqnykamp merged 1 commit intoOct 19, 2026
Merged
Conversation
On a touch device a math input sets inputmode="none" so the device's
keyboard does not compete with the Doenet virtual keyboard. It did so
even when the viewer was embedded with addVirtualKeyboard={false},
leaving the reader with no keyboard at all. That is what readers on an
iPad hit in problem sets on doenet.org, whose assignment viewer turns
the virtual keyboard off.
The viewer now tells its math inputs whether it has a virtual keyboard,
and they suppress the device's keyboard only when it does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix has regression coverage for both configurations, with no unresolved review findings.
No open issues 🎉
What changed in this PR
Preserves the device keyboard for touch users when a DoenetML viewer has no virtual keyboard.
Changes:
- Shares virtual-keyboard availability with math inputs.
- Adds regression coverage for both keyboard configurations.
- Includes patch release notes for affected packages.
🤖 Generated with GitHub Copilot
| File | Description |
|---|---|
| packages/test-cypress/src/CypressTest.tsx | Allows tests to disable the virtual keyboard. |
| packages/test-cypress/cypress/e2e/accessibility/mathInputSystemKeyboard.cy.js | Checks touch-device input modes with and without a virtual keyboard. |
| packages/doenetml/src/Viewer/renderers/mathInput.tsx | Suppresses the device keyboard only when a virtual keyboard is available. |
| packages/doenetml/src/doenetml.tsx | Provides virtual-keyboard availability through context. |
| .changeset/system-keyboard-without-virtual-keyboard.md | Documents the fix for affected packages. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a touch device, a math input sets
inputmode="none"on its textarea so the device's own keyboard won't compete with the Doenet virtual keyboard (#1695). It did this even when the viewer was embedded withaddVirtualKeyboard={false}. In that case there is no Doenet keyboard, so the reader had no keyboard at all.That is what happened in assignments on doenet.org, where the assignment viewer turned the virtual keyboard off (a separate fix there is open as Doenet/assignment-viewer#51). This PR makes DoenetML fail safe on its own, whatever the host does.
The other host that passes
addVirtualKeyboard={false}today is doenet.org's single-document embed page (/embed/:viewId). Its math inputs on a touch device will raise the device's keyboard once a document there renders with a DoenetML release that includes this change. That embed goes throughdoenetml-iframe, which loads the DoenetML version the document asks for. No host was found that turns the Doenet keyboard off and relies on the device's keyboard staying down.Changes
doenetml.tsx: a newVirtualKeyboardAvailableContext, provided byWrapWithKeyboardwith the value ofaddVirtualKeyboard. Inside adoenetml-iframe, the inner viewer receives the host'saddVirtualKeyboard, so the value is correct there too. The context defaults tofalse, so a math input rendered outside a viewer never suppresses the device's keyboard.mathInput.tsx: the device's keyboard is suppressed only when a virtual keyboard is available, the pointer is coarse, and the reader hasn't asked for the system keyboard.test-cypress: the test app accepts anaddVirtualKeyboardmessage, so a spec can turn the keyboard off.accessibility/mathInputSystemKeyboard.cy.jsemulates a touch device. It checks that the textarea'sinputModeisnonewhen the virtual keyboard is present andtextwhen it is absent. The second test fails without themathInput.tsxchange.Test plan
mathInputSystemKeyboard.cy.jspasses, and fails without the fixtagSpecific/mathinput.cy.js,accessibility/virtualKeyboardTouchTargets.cy.js,accessibility/mathInputAriaLabelledby.cy.js🤖 Generated with Claude Code