Skip to content
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

ReadOnly attribute is not passed to the checkbox input #392

Closed
berdyshev opened this issue Apr 27, 2018 · 5 comments
Closed

ReadOnly attribute is not passed to the checkbox input #392

berdyshev opened this issue Apr 27, 2018 · 5 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@berdyshev
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Current behavior
I have this error, however I've passed the readOnly prop into the Checkbox component:
Warning: Failed prop type: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.

Another error I'm experiencing is:
Warning: Failed prop type: The prop `onChange` is marked as required in `Checkbox`, but its value is `null`.

The existence of the onChange prop is checked here so no need to mark onChange prop as required in order to be able the make readonly checkboxes.

Expected behavior
Be able to make readonly checkboxes.

  • React version:
    16.3

  • PrimeReact version:
    1.5.1

  • Browser: all

  • Language: ES6/7

@RobiFerentz
Copy link

This is also a problem when using the SelectButton.

@mertsincan mertsincan self-assigned this May 9, 2018
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label May 9, 2018
@mertsincan mertsincan added this to the 1.6.0 milestone May 9, 2018
@berdyshev
Copy link
Contributor Author

this commit is only fixes the second error, but not the first one — main.

mertsincan added a commit that referenced this issue May 9, 2018
@mertsincan
Copy link
Member

mertsincan commented May 9, 2018

Added readOnly attribute to Checkbox component.

<Checkbox readOnly={true} ...></Checkbox>

First error's already been fixed; #399

@mertsincan
Copy link
Member

@RobiFerentz, could you please create a new issue on github?

@RobiFerentz
Copy link

@mertsincan See #401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

3 participants