Skip to content

Commit

Permalink
fix: add disabled attribute back to FormGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
wkeese committed Jul 29, 2024
1 parent d755f2c commit 03640f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/react/src/components/FormGroup/FormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export interface FormGroupProps extends ReactAttr<HTMLFieldSetElement> {
* Provide a custom className to be applied to the containing <fieldset> node
*/
className?: string;
/**
* Specify whether the FormGroup should be disabled
*/
disabled?: boolean;
/**
* Specify whether the <FormGroup> is invalid
*/
Expand All @@ -45,6 +49,7 @@ export interface FormGroupProps extends ReactAttr<HTMLFieldSetElement> {
}

const FormGroup = ({
disabled = false,
legendId,
legendText,
invalid = false,
Expand All @@ -60,6 +65,7 @@ const FormGroup = ({

return (
<fieldset
disabled={disabled}
{...(invalid && { 'data-invalid': '' })}
className={classNamesFieldset}
{...rest}
Expand Down Expand Up @@ -88,6 +94,11 @@ FormGroup.propTypes = {
*/
className: PropTypes.string,

/**
* Specify whether the FormGroup should be disabled
*/
disabled: PropTypes.bool,

/**
* Specify whether the <FormGroup> is invalid
*/
Expand Down

0 comments on commit 03640f7

Please sign in to comment.