Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit f952450

Browse files
committed
fix(BFormGroup): allow Booleanish and null for state prop
Fixes: bootstrap-vue-next#1167
1 parent 2737f30 commit f952450

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/bootstrap-vue-next/src/components/BFormGroup/BFormGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default defineComponent({
6666
labelFor: {type: String, default: undefined},
6767
labelSize: {type: String, default: undefined},
6868
labelSrOnly: {type: [Boolean, String] as PropType<Booleanish>, default: false},
69-
state: {type: [Boolean, String] as PropType<Booleanish>, default: null},
69+
state: {type: [Boolean, String] as PropType<Booleanish | null>, default: null},
7070
tooltip: {type: [Boolean, String] as PropType<Booleanish>, default: false},
7171
validFeedback: {type: String, default: undefined},
7272
validated: {type: [Boolean, String] as PropType<Booleanish>, default: false},

packages/bootstrap-vue-next/src/components/BFormGroup/form-group.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ describe('form-group', () => {
3131
expect(wrapper.classes()).toContain('is-invalid')
3232
})
3333

34+
it('does not contain a valid class when prop state is null', () => {
35+
const wrapper = mount(BFormGroup, {
36+
props: {state: null},
37+
})
38+
expect(wrapper.classes()).not.toContain('is-valid')
39+
expect(wrapper.classes()).not.toContain('is-invalid')
40+
})
41+
3442
it('does not contain a valid class when prop state is undefined', () => {
3543
const wrapper = mount(BFormGroup, {
3644
props: {state: undefined},

0 commit comments

Comments
 (0)