fix: render position calculator mode switcher correctly in Chrome#32
Merged
ronload merged 1 commit intoApr 29, 2026
Merged
Conversation
Replace fieldset with div role=radiogroup so the absolutely-positioned thumb is sized against a normal block containing box. Chrome reserves anonymous space for legend on fieldset, which made the thumb shorter than its frame; Safari rendered correctly. Behavior and a11y semantics are preserved via aria-disabled and existing button disabled state.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
The mode switcher on
/tool/position-size-calculatorrendered with theactive thumb visibly shorter than its outer frame in Chrome, while
Safari was unaffected.
The wrapper was a
<fieldset>. Chromium reserves anonymous layoutspace for
<legend>even when no legend exists, so an absolutelypositioned child with
inset-y-1did not measure against the paddingbox the way it does in WebKit. Replacing the wrapper with
<div role="radiogroup">gives the thumb a normal containing blockand produces consistent rendering across browsers.
Disabled behavior is preserved via
aria-disabled, the existingpointer-events-nonestyling, thedisabledprop on each button, andthe early-return in
handleSelect/handleKeyDown.Test plan
/tool/position-size-calculatorin Chrome and confirm theactive thumb fills the frame (with the intended 4px inset).
(Arrow keys, Home, End) and confirm transitions still work.