Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Label): add form-label class for labels of vertical forms #2317

Merged
merged 1 commit into from Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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