Skip to content

fix(docs): make checkbox group error demo interactive - #750

Open
pranavkatariain wants to merge 4 commits into
cloudflare:mainfrom
pranavkatariain:fix/checkbox-group-error-demo
Open

fix(docs): make checkbox group error demo interactive#750
pranavkatariain wants to merge 4 commits into
cloudflare:mainfrom
pranavkatariain:fix/checkbox-group-error-demo

Conversation

@pranavkatariain

@pranavkatariain pranavkatariain commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Store the error-group selection in React state instead of freezing its value to an empty array.
  • Clear the validation message and error styling once at least one option is selected.
  • Replace the resolved error with same-height helper text so the demo layout remains stable.
  • Give the centred demo group a stable responsive width so different message lengths do not move it horizontally.

Before and after

Before After
Clicking Email does not retain the checked state. Clicking Email displays the tick and swaps the error for helper text without moving the layout.
Before: Email remains unchecked and the error persists After: Email is checked and the error is replaced by helper text

Verification

  • pnpm --filter @cloudflare/kumo build
  • pnpm exec vp lint packages/kumo-docs-astro/src/components/demos/CheckboxDemo.tsx
  • pnpm --filter @cloudflare/kumo-docs-astro typecheck
  • Manually verified locally that Email changes from aria-checked="false" to aria-checked="true", the error swaps to helper text, the ring returns to its default style, and the preview remains stable on both axes.

  • Reviews
    • bonk has reviewed the change
    • automated review not possible because:
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows: clicked Email in the local error-group demo and confirmed its checked state persists while the error swaps to helper text without shifting the preview vertically or horizontally
    • Additional testing not necessary because:
@pranavkatariain pranavkatariain changed the title fix(docs): preserve checkbox group error demo state Aug 26, 2026
@pranavkatariain
pranavkatariain marked this pull request as ready for review August 26, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant