Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit b461f72

Browse files
author
Mike England
committed
Setup isRequired on Checkbox field
1 parent eedabcf commit b461f72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/molecules/GravityForm/Fields/Checkbox.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function getMergedCheckboxes(checkboxChoices, inputs) {
3232
* @param {string} props.description GravityForm field description.
3333
* @param {Array} props.inputs Array of checkbox field input data.
3434
* @param {string|number} props.id GravityForm field id.
35+
* @param {boolean} props.isRequired If input is required.
3536
* @param {string} props.label GravityForm field label.
3637
* @param {boolean} props.visibility GravityForm field visibility.
3738
* @return {Element} The Checkbox component.
@@ -41,6 +42,7 @@ export default function Checkbox({
4142
checkboxChoices,
4243
description,
4344
id,
45+
isRequired,
4446
inputs,
4547
label,
4648
visibility
@@ -56,6 +58,7 @@ export default function Checkbox({
5658
description={description}
5759
id={fieldId}
5860
label={label}
61+
isRequired={isRequired}
5962
/>
6063
)
6164
}
@@ -66,6 +69,7 @@ Checkbox.propTypes = {
6669
description: PropTypes.string,
6770
id: PropTypes.number.isRequired,
6871
inputs: PropTypes.arrayOf(PropTypes.object),
72+
isRequired: PropTypes.bool,
6973
label: PropTypes.string,
7074
visibility: PropTypes.string
7175
}

0 commit comments

Comments
 (0)