Skip to content

[checkbox] Cleanup disabled state tracking - #3913

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:fix/checkbox-group-disabled-cleanup
Feb 2, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:fix/checkbox-group-disabled-cleanup

Conversation

@atomiks

@atomiks atomiks commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

This state should be cleaned up in checkbox groups.

@atomiks atomiks added type: bug It doesn't behave as expected. component: checkbox Changes related to the checkbox component. labels Feb 1, 2026
@pkg-pr-new

pkg-pr-new Bot commented Feb 1, 2026

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3913
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3913
    

commit: f96eaff

@mui-bot

mui-bot commented Feb 1, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+49B(+0.01%) 🔺+13B(+0.01%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Feb 1, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f96eaff
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/697fa6f4f98a870008f33b0a
😎 Deploy Preview https://deploy-preview-3913--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks marked this pull request as ready for review February 1, 2026 19:31
@greptile-apps

greptile-apps Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Added cleanup function to useEffect hook that properly removes disabled state entries from the parent checkbox group's disabledStatesRef Map when child checkboxes unmount. Previously, the effect only set values but never cleaned them up, causing the Map to accumulate stale entries for unmounted checkboxes.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward memory leak fix that adds proper cleanup to an existing effect. The refactoring also improves code clarity by early-returning when conditions aren't met and extracting the Map reference to a local variable.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/checkbox/root/CheckboxRoot.tsx Added cleanup function to remove disabled state from Map when checkbox unmounts

@atomiks
atomiks merged commit 6211e65 into mui:master Feb 2, 2026
9 checks passed
@atomiks
atomiks deleted the fix/checkbox-group-disabled-cleanup branch February 2, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: checkbox Changes related to the checkbox component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants