Skip to content

Commit

Permalink
fix(Label): add form-label class for labels of vertical forms (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
phwebi committed Oct 27, 2021
1 parent 52e898d commit 3bfce12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Label.js
Expand Up @@ -99,7 +99,7 @@ const Label = (props) => {
check ? 'form-check-label' : false,
size ? `col-form-label-${size}` : false,
colClasses,
colClasses.length ? 'col-form-label' : false
colClasses.length ? 'col-form-label' : 'form-label'
), cssModule);

return (
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Label.spec.js
Expand Up @@ -27,10 +27,10 @@ describe('Label', () => {
expect(wrapper.hasClass('col-form-label')).toBe(true);
});

it('should not render with "col-form-label" class when a col is not provided', () => {
it('should render with "form-label" class when a col is not provided', () => {
const wrapper = shallow(<Label>Yo!</Label>);

expect(wrapper.hasClass('col-form-label')).toBe(false);
expect(wrapper.hasClass('form-label')).toBe(true);
});

it('should pass col size specific classes as Strings', () => {
Expand Down

0 comments on commit 3bfce12

Please sign in to comment.