Skip to main content
SUNDAY SYSTEMS DIGEST · ONE MEASURED ESSAY EVERY WEEKREAD · BENCHMARK · REFLECTZERO TRACKING PIXELS · FULL RSS & MARKDOWN ARCHIVENEW BENCHMARK: DETERMINISTIC RAFT LEASE QUORUMS
KERN.

Search Archive

Recent & Most Read Essays (8)

Top-Layer HTML Dialogs and Tactile Braille Focus Discipline

Replacing 14 kilobytes of custom JavaScript focus-trap listeners with native `<dialog>`, CSS `overscroll-behavior`, and live-region hygiene tested on physical 40-cell refreshable braille hardware.

Henrik Lindqvist
Henrik Lindqvist

Principal Systems Architect · Stockholm

Sep 13, 20267 min read255 words
Top-Layer HTML Dialogs and Tactile Braille Focus Discipline

For a decade, frontend libraries shipped brittle Tab-key interceptors, MutationObserver subtree walkers, and document.body.style.overflow = 'hidden' hacks just to open a search modal. Every single one of those workarounds breaks in subtle ways when paired with a physical 40-cell refreshable braille display and VoiceOver or NVDA.

What showModal() Gives You Without Script

When you open a <dialog> via dialog.showModal(), the browser engine promotes the node into the top layer, marks sibling document subtrees inert at the accessibility-tree level, handles Escape and mobile back gestures natively, and remembers the exact invoker button for focus restoration on close.

css
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgb(15 23 42 / 0.48);
  backdrop-filter: blur(4px);
}

Mutating overflow: hidden on <html> or <body> strips the root scrollbar, shifting centered editorial columns horizontally by 15px and breaking position: sticky table-of-contents sidebars. Setting overflow: hidden and overscroll-behavior: contain directly on dialog::backdrop turns the backdrop into a non-scrollable scroll container without touching page geometry.

Live Regions Outside Presentational Buttons

While testing code-block copy buttons on a Focus 40 Blue braille bar, we caught a classic defect: placing <span role="status">Copied</span> inside a <button> causes screen readers to ignore updates because button descendants are treated as presentational text. Moving the role="status" sibling outside the button—and hiding inactive bubbles via opacity: 0 rather than display: none—produced reliable braille flash notifications on every browser.

Keeping Build Outputs Lean

Deleting legacy focus-trap and accordion packages shaved 19.4 KB of compressed client script from our article pages. Combined with the hermetic asset pipeline in Content-Addressed Monorepo Build Caches Without Silent CI Drift and runtime budgets measured in Anatomy of a Sub-Millisecond WebAssembly Component Cold Start, reader pages paint cleanly in a single TCP congestion window.

Connected Architecture Notes

Henrik Lindqvist

Henrik Lindqvist

Stockholm · UTC+1

Principal distributed systems architect writing weekly benchmarks on consensus protocols, storage engines, WebAssembly isolates, and tactile web accessibility.

Reader Field Notes

1 verified note
  • Samira Al-Mansoor

    Design Systems & Accessibility · London

    Sep 14, 2026

    Thank you for testing on an actual 40-cell refreshable braille display! Keeping `role="status"` outside `<button>` fixed a silent copy-confirmation regression in our internal documentation site.

Contribute a Technical Note

Moderated manually for signal-to-noise. Your email is never stored in public comment properties.

Enter your display name.
Enter a valid email or leave blank.
Please write at least 8 characters.
Please confirm publication consent.

Continue Reading

All essays →

Get next Sunday’s benchmark by email

Full essay in plain HTML, zero tracking pixels, one-click unsubscribe.

Enter a valid email address (for example, name@domain.com).