@@ -2,6 +2,7 @@ import { Vue, mergeData } from '../../vue'
22import { NAME_DROPDOWN_GROUP } from '../../constants/components'
33import { PROP_TYPE_ARRAY_OBJECT_STRING , PROP_TYPE_STRING } from '../../constants/props'
44import { SLOT_NAME_DEFAULT , SLOT_NAME_HEADER } from '../../constants/slots'
5+ import { isTag } from '../../utils/dom'
56import { identity } from '../../utils/identity'
67import { hasNormalizedSlot , normalizeSlot } from '../../utils/normalize-slot'
78import { omit } from '../../utils/object'
@@ -29,24 +30,25 @@ export const BDropdownGroup = /*#__PURE__*/ Vue.extend({
2930 functional : true ,
3031 props,
3132 render ( h , { props, data, slots, scopedSlots } ) {
33+ const { id, variant, header, headerTag } = props
3234 const $slots = slots ( )
3335 const $scopedSlots = scopedSlots || { }
3436 const slotScope = { }
35- const headerId = props . id ? `_bv_${ props . id } _group_dd_header` : null
37+ const headerId = id ? `_bv_${ id } _group_dd_header` : null
3638
3739 let $header = h ( )
38- if ( hasNormalizedSlot ( SLOT_NAME_HEADER , $scopedSlots , $slots ) || props . header ) {
40+ if ( hasNormalizedSlot ( SLOT_NAME_HEADER , $scopedSlots , $slots ) || header ) {
3941 $header = h (
40- props . headerTag ,
42+ headerTag ,
4143 {
4244 staticClass : 'dropdown-header' ,
43- class : [ props . headerClasses , { [ `text-${ props . variant } ` ] : props . variant } ] ,
45+ class : [ props . headerClasses , { [ `text-${ variant } ` ] : variant } ] ,
4446 attrs : {
4547 id : headerId ,
46- role : 'heading'
48+ role : isTag ( headerTag , 'header' ) ? null : 'heading'
4749 }
4850 } ,
49- normalizeSlot ( SLOT_NAME_HEADER , slotScope , $scopedSlots , $slots ) || props . header
51+ normalizeSlot ( SLOT_NAME_HEADER , slotScope , $scopedSlots , $slots ) || header
5052 )
5153 }
5254
@@ -58,7 +60,7 @@ export const BDropdownGroup = /*#__PURE__*/ Vue.extend({
5860 staticClass : 'list-unstyled' ,
5961 attrs : {
6062 ...( data . attrs || { } ) ,
61- id : props . id || null ,
63+ id,
6264 role : 'group' ,
6365 'aria-describedby' :
6466 [ headerId , props . ariaDescribedBy ]
0 commit comments