You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checkboxes (and all other inputs) should be usable as uncontrolled components, allowing for native HTML Form behavior.
Reproducer
N/A
PrimeReact version
10.6.6
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Any/All
Steps to reproduce the behavior
Add a Checkbox component inside a form without specifying a checked prop:
Click the checkbox
Nothing happens
Expected behavior
The checkbox should behave as a native HTML checkbox, and only work as a controlled component when state is explicitly passed via the checked prop.
PS > I see that the current solution to this was to remove the defaultChecked prop from the Checkbox component to make it exclusively controlled. In my humble opinion, this is a step backwards as default HTML behavior should always be preserved in component libraries, at least for standard components that are already available in the browser.
The text was updated successfully, but these errors were encountered:
Describe the bug
Checkboxes (and all other inputs) should be usable as uncontrolled components, allowing for native HTML Form behavior.
Reproducer
N/A
PrimeReact version
10.6.6
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Any/All
Steps to reproduce the behavior
checked
prop:Expected behavior
The checkbox should behave as a native HTML checkbox, and only work as a controlled component when state is explicitly passed via the
checked
prop.PS > I see that the current solution to this was to remove the
defaultChecked
prop from theCheckbox
component to make it exclusively controlled. In my humble opinion, this is a step backwards as default HTML behavior should always be preserved in component libraries, at least for standard components that are already available in the browser.The text was updated successfully, but these errors were encountered: