Skip to content

Checkbox: value prop not being used to populate the input's value attribute #7762

@maxchan23

Description

@maxchan23

Describe the bug

When using the value prop in a Checkbox component, I noticed that the value is not being used to populate the actual input's value attribute.

Image

Reproducer

No response

System Information

-

Steps to reproduce the behavior

  1. Go to the Checkbox documentation -> scroll to the Dynamic section : https://primereact.org/checkbox/
  2. inspect the Marketing checkbox, click into its input element
  3. the value attribute is not being set as intended even though the category is being passed in as a value prop

Expected behavior

The value should be used to populate the input's value attribute. I'm currently working around this by adding a defaultValue in the pt prop like so pt={{ input: { defaultValue: category } }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugIssue contains a defect related to a specific component.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions