Skip to content

Commit

Permalink
fix(Form.Group): add disabled flag
Browse files Browse the repository at this point in the history
  • Loading branch information
naman1608 committed Sep 1, 2023
1 parent d4fe69a commit d7cdfa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/collections/Form/FormGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export interface StrictFormGroupProps {
/** Additional classes. */
className?: string

/** A Form Group can be disabled. */
disabled?: boolean

/** Fields can show related choices. */
grouped?: boolean

Expand Down
6 changes: 5 additions & 1 deletion src/collections/Form/FormGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import {
* @see Form
*/
const FormGroup = React.forwardRef((props, ref) => {
const { children, className, grouped, inline, unstackable, widths } = props
const { children, className, disabled, grouped, inline, unstackable, widths } = props

const classes = cx(
useKeyOnly(disabled, 'disabled'),
useKeyOnly(grouped, 'grouped'),
useKeyOnly(inline, 'inline'),
useKeyOnly(unstackable, 'unstackable'),
Expand Down Expand Up @@ -48,6 +49,9 @@ FormGroup.propTypes = {
/** Additional classes. */
className: PropTypes.string,

/** A Form Group can be disabled. */
disabled: PropTypes.bool,

/** Fields can show related choices. */
grouped: customPropTypes.every([customPropTypes.disallow(['inline']), PropTypes.bool]),

Expand Down

0 comments on commit d7cdfa3

Please sign in to comment.