Properties "disabled" and "onChange" are working inconsistently together #68664
Labels
[Feature] UI Components
Impacts or related to the UI component system
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Bug
An existing feature does not function as intended
Description
I want to display certain controls as disabled.
Usually and most of the time, it's enough to pass the
disabled
property to make the option disabled.But various controls require you to also set the
onChange
to do nothing, otherwise I get an error in browser console.See steps below for examples.
Possibly related: #59411
Step-by-step reproduction instructions
disabled
is enough:onChange
that does nothing:Note the
onChange={() => {}}
which is required for some reason.Without it, when a color is selected (even though it's set as disabled) I get this error:
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: