Skip to content

Commit

Permalink
fix(FormGroup): only place className on outer wrapper (#9526)
Browse files Browse the repository at this point in the history
* fix(FormGroup): only place className on outer wrapper

* chore(storybook): remove test story
  • Loading branch information
tw15egan authored Sep 10, 2021
1 parent c1e34b2 commit 22372ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react/src/components/FormGroup/FormGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import { settings } from 'carbon-components';
import { useFeatureFlag } from '../FeatureFlags';

const { prefix } = settings;

Expand All @@ -23,7 +24,10 @@ const FormGroup = ({
hasMargin,
...other
}) => {
const classNamesLegend = classnames(`${prefix}--label`, className);
const enabled = useFeatureFlag('enable-v11-release');
const classNamesLegend = classnames(`${prefix}--label`, [
enabled ? null : className,
]);
const classNamesFieldset = classnames(`${prefix}--fieldset`, className, {
[`${prefix}--fieldset--no-margin`]: !hasMargin,
});
Expand Down

0 comments on commit 22372ff

Please sign in to comment.