Skip to content

Fix disabled boolean input #10773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025
Merged

Fix disabled boolean input #10773

merged 2 commits into from
Jun 10, 2025

Conversation

Madeorsk
Copy link
Contributor

@Madeorsk Madeorsk commented Jun 10, 2025

Problem

There is a rerender loop when viewing the boolean input story when is it disabled.

Solution

Do not try to reset the field when the input is disabled. If you need an updated defaultValue while still having the input disabled, you should use readOnly.

How To Test

View and play with the Disabled story of BooleanInput: https://react-admin-storybook-i09ggoby2-marmelab.vercel.app/?path=/story/ra-ui-materialui-input-booleaninput--disabled

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@Madeorsk Madeorsk added the RFR Ready For Review label Jun 10, 2025
@Madeorsk Madeorsk marked this pull request as ready for review June 10, 2025 09:23
@djhi djhi added this to the 5.8.4 milestone Jun 10, 2025
@djhi djhi merged commit d3a29a6 into master Jun 10, 2025
15 checks passed
@djhi djhi deleted the fix-disabled-boolean-input branch June 10, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Development

Successfully merging this pull request may close these issues.

2 participants