Skip to content

fix: [checkbox] avoid a freeze when many boxes uncheck at once - #1035

Merged
rohanchkrabrty merged 3 commits into
mainfrom
fix/checkbox-deselect-all
Dec 3, 2026
Merged

rohanchkrabrty merged 3 commits into
mainfrom
fix/checkbox-deselect-all

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Unchecking many Checkboxes at once froze the page. Base UI calls getAnimations() on each indicator that unchecks, and while the indicator has a CSS transition, each call gets slower as more boxes uncheck. In headless Chrome, deselect-all on a DataView list took 10 s at 500 rows and 42 s at 1,000 rows.
  • The indicator has no transition now. The icon fades in with a keyframe animation, so checking still animates. Unchecking hides the icon at once, so the code that kept the old icon during the exit is removed.
  • Base UI 1.9 renders an unnamed hidden input as 1px and position: fixed, and Chrome gives each one a compositor layer. The input is now zero size unless it has a name or is required, as in [form controls] Avoid a compositor layer per hidden input without a name mui/base-ui#6049. The override can go once Apsara uses a Base UI release with that fix.
  • Checked and indeterminate boxes use border-style: none instead of border: none, so a toggle starts one transition instead of five.
  • Deselect-all on 5,000 rows now settles in 1.25 s and select-all in 1.9 s (3.3 s and 5.9 s with the first commit only). Combobox and Select multi-select items render this Checkbox, so they get the fix too.

Base UI calls getAnimations() on each indicator that unchecks. While the indicator has a CSS transition, each call gets slower as more boxes uncheck, so deselecting all rows of a 1,000-row list blocked the page for about 40 seconds. The icon now fades in with a keyframe animation and the indicator has no transition. The icon leaves at once on uncheck, so the code that kept the old icon during the exit is gone.
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
apsara Ready Ready Preview Dec 2, 2026 9:31pm UTC

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8de6deb3-a7c2-4313-926c-e24473366041
Commits

Reviewing files that changed from the base of the PR and between 198f790 and 6259fdc.

Files selected for processing: 2

  • packages/react/components/checkbox/checkbox.module.css
  • packages/react/components/checkbox/checkbox.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@1035

commit: 6259fdc

…transition

Base UI 1.9 renders an unnamed hidden input as 1px and position: fixed, and Chrome gives each one a compositor layer, so every repaint of a list with thousands of checkboxes spent most of its time in layerization. The input is now zero size unless it has a name or is required, as in mui/base-ui#6049. Checked and indeterminate boxes use border-style: none instead of border: none, so a toggle no longer starts four border-color transitions next to the background one.
@rohanchkrabrty
rohanchkrabrty merged commit da31f67 into main Dec 3, 2026
8 checks passed
@rohanchkrabrty
rohanchkrabrty deleted the fix/checkbox-deselect-all branch December 3, 2026 07:55

This branch was successfully deployed

1 active deployment
Preview — 6259fdc7 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants