@@ -2,6 +2,7 @@ import { Vue, mergeData } from '../../vue'
2
2
import { NAME_DROPDOWN_GROUP } from '../../constants/components'
3
3
import { PROP_TYPE_ARRAY_OBJECT_STRING , PROP_TYPE_STRING } from '../../constants/props'
4
4
import { SLOT_NAME_DEFAULT , SLOT_NAME_HEADER } from '../../constants/slots'
5
+ import { isTag } from '../../utils/dom'
5
6
import { identity } from '../../utils/identity'
6
7
import { hasNormalizedSlot , normalizeSlot } from '../../utils/normalize-slot'
7
8
import { omit } from '../../utils/object'
@@ -29,24 +30,25 @@ export const BDropdownGroup = /*#__PURE__*/ Vue.extend({
29
30
functional : true ,
30
31
props,
31
32
render ( h , { props, data, slots, scopedSlots } ) {
33
+ const { id, variant, header, headerTag } = props
32
34
const $slots = slots ( )
33
35
const $scopedSlots = scopedSlots || { }
34
36
const slotScope = { }
35
- const headerId = props . id ? `_bv_${ props . id } _group_dd_header` : null
37
+ const headerId = id ? `_bv_${ id } _group_dd_header` : null
36
38
37
39
let $header = h ( )
38
- if ( hasNormalizedSlot ( SLOT_NAME_HEADER , $scopedSlots , $slots ) || props . header ) {
40
+ if ( hasNormalizedSlot ( SLOT_NAME_HEADER , $scopedSlots , $slots ) || header ) {
39
41
$header = h (
40
- props . headerTag ,
42
+ headerTag ,
41
43
{
42
44
staticClass : 'dropdown-header' ,
43
- class : [ props . headerClasses , { [ `text-${ props . variant } ` ] : props . variant } ] ,
45
+ class : [ props . headerClasses , { [ `text-${ variant } ` ] : variant } ] ,
44
46
attrs : {
45
47
id : headerId ,
46
- role : 'heading'
48
+ role : isTag ( headerTag , 'header' ) ? null : 'heading'
47
49
}
48
50
} ,
49
- normalizeSlot ( SLOT_NAME_HEADER , slotScope , $scopedSlots , $slots ) || props . header
51
+ normalizeSlot ( SLOT_NAME_HEADER , slotScope , $scopedSlots , $slots ) || header
50
52
)
51
53
}
52
54
@@ -58,7 +60,7 @@ export const BDropdownGroup = /*#__PURE__*/ Vue.extend({
58
60
staticClass : 'list-unstyled' ,
59
61
attrs : {
60
62
...( data . attrs || { } ) ,
61
- id : props . id || null ,
63
+ id,
62
64
role : 'group' ,
63
65
'aria-describedby' :
64
66
[ headerId , props . ariaDescribedBy ]
0 commit comments