Make icon controls real <button>s (#341); harden text inputs against host CSS#363
Merged
CarlosNZ merged 5 commits intoJun 15, 2026
Merged
Conversation
Bundle size impact
|
| Format | Base raw | PR raw | Δ raw | Base gzip | PR gzip | Δ gzip |
|---|---|---|---|---|---|---|
| esm | 55.68 KB | 56.47 KB | 🔺 +807 B (+1.42%) | 19.98 KB | 20.13 KB | 🔺 +156 B (+0.76%) |
| cjs | 57.19 KB | 57.97 KB | 🔺 +807 B (+1.38%) | 20.07 KB | 20.22 KB | 🔺 +157 B (+0.76%) |
Measured from build/index.{cjs,esm}.js. Gzip at level 9.
Broaden the "New localisation keys" section to cover the confirm/cancel button labels added in this PR, and cross-reference ITEMS_FILTERED to its existing home under the showCollectionCount change rather than duplicating it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Three related changes that came out of working through #341, kept as separate commits:
<button>s #341 — icon controls become real<button>s (Change div to button)Harden autogrow textarea line-height against host disruption)/raw-htmldemo route (Add raw html page (no Chakra) to demo)Closes #341.
1. Real
<button>icon controls (#341)The ✓ / ✗ confirm-cancel pair and the edit/copy/delete/add icons were
<div onClick>— invisible to assistive tech and not natively actionable. They're now<button type="button">with:aria-label(always present, independent ofshowIconTooltips) sourced from theTOOLTIP_*localisation strings, so screen readers announce them;tabIndex={-1}, keeping them out of the editor's field-to-field Tab flow — the field itself already commits/cancels via Enter/Escape (keyboardControls), so these are pointer affordances, not new tab stops;src/style.css(scoped> button) so they render pixel-identical to the old divs.Two new localisation keys (
TOOLTIP_OK,TOOLTIP_CANCEL) label the confirm/cancel buttons; the edit-icontitletooltips stay gated onshowIconTooltips.editConfirmRefchanges typeHTMLDivElement → HTMLButtonElement(internal only). Custom buttons (customButtons) stay<div>-wrapped to avoid nesting interactive content.Breaking for consumer CSS only: selectors like
.jer-confirm-buttons > divmust become.jer-confirm-buttons > button. Documented in the migration guide.2. Text-input hardening against host CSS
The string and raw-JSON editors now pin
box-sizing: content-boxand an explicitline-heightinstead of inheriting them, so a host app's global reset (* { box-sizing: border-box }) or an element-leveltextarea/inputrule can no longer distort their layout or breakAutogrowTextArea's hidden measuring<span>.content-boxis the model the editor was designed against, so it's a no-op for consumers without a global reset; the raw-JSON editor's line spacing is now set explicitly (1.25em) and shifts very slightly. This also closes a latent height-measurement mismatch in the raw-JSON autogrow that existed even with no host reset.3.
/raw-htmldemo routeA bare
JsonEditor(StarWars dataset) rendered outsideChakraProviderand any UI-framework reset — a reference for how the library looks to a plain-HTML consumer. Direct-URL only, not linked from nav. Demo-only, no changeset.Changesets
button-controls-accessibility.md—json-edit-react: major(the consumer CSS-selector break)text-input-host-css-hardening.md—json-edit-react: patchTesting
pnpm lint,pnpm compile,pnpm testall green (491 passing, 2 todo).<button>,type="button",tabIndex={-1},aria-labels) and the tooltip gating; existing.jer-confirm-buttons > divtest selectors updated to> button.🤖 Generated with Claude Code