Skip to content

fix: add CSS class to keyboard container to prevent crash#184

Merged
thewrz merged 1 commit intomainfrom
fix/keyboard-dom-class
Feb 23, 2026
Merged

fix: add CSS class to keyboard container to prevent crash#184
thewrz merged 1 commit intomainfrom
fix/keyboard-dom-class

Conversation

@thewrz
Copy link
Owner

@thewrz thewrz commented Feb 23, 2026

Summary

  • Add className="kiosk-keyboard" to the <div ref={containerRef} /> in KioskKeyboard.tsx
  • simple-keyboard throws KEYBOARD_DOM_CLASS_ERROR when the DOM element has no CSS class, crashing the entire display page

Root cause

simple-keyboard checks element.classList.length === 0 in its constructor and throws if no class is present. Our bare <div ref={containerRef} /> had no class. The error was uncaught, triggering Next.js's client-side error boundary ("Application error").

This was not caught in tests because the test mock replaces the real simple-keyboard constructor entirely.

Test plan

  • 14/14 RequestModal tests pass
  • TypeScript clean
  • Verify on Pi kiosk: tap "Request a Song" → keyboard appears without crash

🤖 Generated with Claude Code

…S_ERROR

simple-keyboard requires the DOM element passed to its constructor to
have at least one CSS class. The bare `<div ref={containerRef} />`
had none, causing an uncaught error that crashed the kiosk display.
@thewrz thewrz merged commit 86ee61f into main Feb 23, 2026
8 checks passed
@thewrz thewrz deleted the fix/keyboard-dom-class branch February 23, 2026 23:40
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.

1 participant