Repository navigation
fix(Button): render a real button when nothing is wired - #612
Merged
Merged
Conversation
A Button or IconButton with no onClick, href or type rendered a plain div, so screen readers and agents read an unwired action as text. It is now a <button type="button"> everywhere except inside a control core draws (clickable Card, Kbar trigger, CompareImage handle, Accordion header). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
Blocks that draw their own control around a Button (ScrollToTop, StylePanel swatches) nested a button in it once unwired Buttons became real buttons. An aria-hidden Button is decoration, and InsideControl marks the rest. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
7 tasks done
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.
What
A
ButtonorIconButtonwith noonClick,hrefortypeused to render a plain div. Screen readers and agents operating the page read it as text. The agent-operate benchmark (#610) showed this with "Delete workspace" inai/examples/settings.tsx.It now renders
<button type="button">, so it never submits a form by accident. It stays a plain div only inside a control core draws, so no button nests inside another:CardCompareImage's handleAccordionheaderThese controls share a new internal
InsideControlContext, which is not exported.The development warnings now cover two cases:
<form>still warns that it won't submit.Checks
gotchas.json, the AI bundles, MIGRATING.md and CHANGELOG (Unreleased).The element changes from div to button, so I labelled this
visual-change. The Compare check covers blocks and examples.Generated by Claude Code