Skip to content

fix: render position calculator mode switcher correctly in Chrome#32

Merged
ronload merged 1 commit into
mainfrom
fix/position-size-calculator-switcher-break-on-chrome
Apr 29, 2026
Merged

fix: render position calculator mode switcher correctly in Chrome#32
ronload merged 1 commit into
mainfrom
fix/position-size-calculator-switcher-break-on-chrome

Conversation

@ronload
Copy link
Copy Markdown
Owner

@ronload ronload commented Apr 29, 2026

Summary

The mode switcher on /tool/position-size-calculator rendered with the
active thumb visibly shorter than its outer frame in Chrome, while
Safari was unaffected.

The wrapper was a <fieldset>. Chromium reserves anonymous layout
space for <legend> even when no legend exists, so an absolutely
positioned child with inset-y-1 did not measure against the padding
box the way it does in WebKit. Replacing the wrapper with
<div role="radiogroup"> gives the thumb a normal containing block
and produces consistent rendering across browsers.

Disabled behavior is preserved via aria-disabled, the existing
pointer-events-none styling, the disabled prop on each button, and
the early-return in handleSelect / handleKeyDown.

Test plan

  • Open /tool/position-size-calculator in Chrome and confirm the
    active thumb fills the frame (with the intended 4px inset).
  • Open the same page in Safari and confirm rendering is unchanged.
  • Toggle between "Regular" and "Community" with mouse and keyboard
    (Arrow keys, Home, End) and confirm transitions still work.

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.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kaiyn-website Ready Ready Preview, Comment Apr 29, 2026 7:27am

@ronload ronload self-assigned this Apr 29, 2026
@ronload ronload added the bug Something isn't working label Apr 29, 2026
@ronload ronload merged commit 3b0c04f into main Apr 29, 2026
6 checks passed
@ronload ronload deleted the fix/position-size-calculator-switcher-break-on-chrome branch April 29, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant