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

Commit ebeb6d1

Browse files
committed
fix(BAlert): remove deprecated property and aria-label for BButton.
1 parent cedbaed commit ebeb6d1

File tree

2 files changed

+1
-43
lines changed

2 files changed

+1
-43
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{ closeContent }}
1717
</slot>
1818
</BButton>
19-
<BCloseButton v-else aria-label="closeLabel" v-bind="closeAttrs" @click="hide" />
19+
<BCloseButton v-else :aria-label="closeLabel" v-bind="closeAttrs" @click="hide" />
2020
</template>
2121
</div>
2222
</BTransition>
@@ -37,7 +37,6 @@ const props = withDefaults(
3737
closeVariant?: ButtonVariant | null
3838
closeClass?: ClassValue
3939
closeLabel?: string
40-
closeWhite?: Booleanish
4140
closeContent?: string
4241
noHoverPause?: Booleanish
4342
dismissible?: Booleanish
@@ -52,7 +51,6 @@ const props = withDefaults(
5251
closeVariant: 'secondary',
5352
closeClass: undefined,
5453
closeLabel: 'Close',
55-
closeWhite: false,
5654
closeContent: undefined,
5755
noHoverPause: false,
5856
interval: 1000,
@@ -126,7 +124,6 @@ const isAlertVisible = computed<boolean>(() =>
126124
127125
const closeAttrs = computed(() => ({
128126
variant: hasCloseSlot.value ? props.closeVariant : undefined,
129-
white: !hasCloseSlot.value ? props.closeWhite : undefined,
130127
class: closeClasses.value,
131128
}))
132129

packages/bootstrap-vue-next/src/components/BAlert/alert.spec.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ describe('alert', () => {
212212
expect($bclosebutton.attributes('aria-label')).toBe('Close')
213213
})
214214

215-
it('nested div BButton has aria-label to be Close by default', () => {
216-
const wrapper = mount(BAlert, {
217-
props: {modelValue: true, dismissible: true},
218-
slots: {close: 'foobar'},
219-
})
220-
const $div = wrapper.get('div')
221-
const $bbutton = $div.getComponent(BButton)
222-
expect($bbutton.attributes('aria-label')).toBe('Close')
223-
})
224-
225215
it('nested div BCloseButton has aria-label to be prop closeLabel', () => {
226216
const wrapper = mount(BAlert, {
227217
props: {modelValue: true, dismissible: true, closeLabel: 'foobar'},
@@ -231,16 +221,6 @@ describe('alert', () => {
231221
expect($bclosebutton.attributes('aria-label')).toBe('foobar')
232222
})
233223

234-
it('nested div BButton has aria-label to be prop closeLabel', () => {
235-
const wrapper = mount(BAlert, {
236-
props: {modelValue: true, dismissible: true, closeLabel: 'foobar'},
237-
slots: {close: 'foobar'},
238-
})
239-
const $div = wrapper.get('div')
240-
const $bbutton = $div.getComponent(BButton)
241-
expect($bbutton.attributes('aria-label')).toBe('foobar')
242-
})
243-
244224
// BCloseButton variant
245225
it('nested div BCloseButton emits update:modelValue when clicked when modelValue boolean', async () => {
246226
const wrapper = mount(BAlert, {
@@ -303,15 +283,6 @@ describe('alert', () => {
303283
expect($bclosebutton.classes()).toContain('foobar')
304284
})
305285

306-
it('nested div BCloseButton has class when prop closeWhite', () => {
307-
const wrapper = mount(BAlert, {
308-
props: {modelValue: true, dismissible: true, closeWhite: true},
309-
})
310-
const $div = wrapper.get('div')
311-
const $bclosebutton = $div.getComponent(BCloseButton)
312-
expect($bclosebutton.classes()).toContain('btn-close-white')
313-
})
314-
315286
it('nested div BCloseButton has no class when no slot close', () => {
316287
const wrapper = mount(BAlert, {
317288
props: {modelValue: true, dismissible: true},
@@ -397,16 +368,6 @@ describe('alert', () => {
397368
expect($bbutton.classes()).toContain('foobar')
398369
})
399370

400-
it('nested div BButton has no class when prop closeWhite', () => {
401-
const wrapper = mount(BAlert, {
402-
props: {modelValue: true, dismissible: true, closeWhite: true},
403-
slots: {close: 'foobar'},
404-
})
405-
const $div = wrapper.get('div')
406-
const $bbutton = $div.getComponent(BButton)
407-
expect($bbutton.classes()).not.toContain('btn-close-white')
408-
})
409-
410371
it('nested div BButton has class when slot close', () => {
411372
const wrapper = mount(BAlert, {
412373
props: {modelValue: true, dismissible: true},

0 commit comments

Comments
 (0)