Skip to content

Show the virtual keyboard in assignments - #51

Merged
dqnykamp merged 2 commits into
Doenet:mainfrom
dqnykamp:virtual-keyboard-in-assignments
Oct 19, 2026
Merged

dqnykamp merged 2 commits into
Doenet:mainfrom
dqnykamp:virtual-keyboard-in-assignments

Conversation

@dqnykamp

@dqnykamp dqnykamp commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Assignments on doenet.org show no Doenet virtual keyboard. On an iPad, math inputs get no keyboard at all, because DoenetML keeps the device's own keyboard down on touch devices so it won't compete with the Doenet keyboard. Example: https://doenet.org/activityViewer/3VTecFFh2wLPoVrf4bh91i

The cause is in this package. SingleDocActivity passed addVirtualKeyboard={false} to every document's DoenetViewer, and Viewer accepted an addVirtualKeyboard prop without using it, so nothing could turn the keyboard on.

Changes

  • addVirtualKeyboard now goes ActivityViewer → Viewer → Activity → SingleDocActivity → DoenetViewer, defaulting to true. Each viewer's iframe wrapper registers with one tray shared by the whole page, so an assignment of many documents still shows a single keyboard.
  • New component spec ActivityViewer.virtualKeyboard.cy.tsx: a two-document sequence shows exactly one tray by default, and none with addVirtualKeyboard={false}. With the old hard-coded false restored, the default case fails.
  • The tray's styles come from @doenet/doenetml-iframe/style.css, which the host page must import (doenet.org already does). The dev app now imports it, and the README says a host needs it; without it the tray's keys appear unstyled at the end of the page.
  • Version bumped to 0.1.0-alpha-19. The version recorded in package-lock.json still said alpha-17, so it is brought up to match.

This works with the current @doenet/doenetml-iframe 0.7.24, so no DoenetML upgrade is needed. The companion PR Doenet/DoenetML#2287 handles the other half: a host that does turn the keyboard off will no longer take away the device's keyboard too.

Test plan

  • ActivityViewer.virtualKeyboard.cy.tsx passes, and fails against the old behavior
  • npm run build, eslint
  • Check on an iPad after release

🤖 Generated with Claude Code

Every document's viewer was given addVirtualKeyboard={false}, and the
addVirtualKeyboard prop of ActivityViewer was accepted but never used,
so an assignment had no Doenet virtual keyboard. On a touch device a
math input also keeps the device's own keyboard down, which left readers
on an iPad with no keyboard at all.

addVirtualKeyboard now reaches each document's viewer, defaulting to
true. The viewers share a single keyboard tray on the page.

Bump the version to 0.1.0-alpha-19, and bring the version recorded in
package-lock.json, which still said alpha-17, up to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The keyboard tray takes its styles from @doenet/doenetml-iframe's
stylesheet, which the host page has to import. Now that the keyboard is on
by default, the dev app showed the tray's keys unstyled at the end of the
page, since it never imported that stylesheet. Import it there, and say in
the README that a host page needs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused prop-forwarding change has regression coverage, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Restores the shared Doenet virtual keyboard in assignments by forwarding addVirtualKeyboard to each document viewer.

Changes:

  • Enables the keyboard by default while preserving explicit opt-out.
  • Adds regression tests and stylesheet setup guidance.
  • Updates package versions to 0.1.0-alpha-19.
File Description
test/​cypress/​component/​ActivityViewer.virtualKeyboard.cy.tsx Tests shared-tray behavior and opt-out.
src/​Viewer/​Viewer.tsx Forwards the keyboard setting to activities.
src/​Activity/​SingleDocActivity.tsx Passes the setting to DoenetViewer.
src/​Activity/​Activity.tsx Declares the shared keyboard option.
README.md Documents required styles and opt-out.
package.json Bumps the release version.
package-lock.json Synchronizes release versions.
dev/​main.tsx Imports keyboard styles for development.

Review effort: Balanced

@dqnykamp
dqnykamp merged commit 928914c into Doenet:main Oct 19, 2026
4 checks passed
@dqnykamp
dqnykamp deleted the virtual-keyboard-in-assignments branch October 19, 2026 21:00
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