+13
-10
lines changedFilter options
+13
-10
lines changed Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1
1
import { Vue, mergeData } from '../../vue'
2
2
import { NAME_DROPDOWN_HEADER } from '../../constants/components'
3
3
import { PROP_TYPE_STRING } from '../../constants/props'
4
+
import { isTag } from '../../utils/dom'
4
5
import { omit } from '../../utils/object'
5
6
import { makeProp, makePropsConfigurable } from '../../utils/props'
6
7
@@ -23,18 +24,18 @@ export const BDropdownHeader = /*#__PURE__*/ Vue.extend({
23
24
functional: true,
24
25
props,
25
26
render(h, { props, data, children }) {
26
-
const { variant } = props
27
+
const { tag, variant } = props
27
28
28
29
return h('li', mergeData(omit(data, ['attrs']), { attrs: { role: 'presentation' } }), [
29
30
h(
30
-
props.tag,
31
+
tag,
31
32
{
32
33
staticClass: 'dropdown-header',
33
34
class: { [`text-${variant}`]: variant },
34
35
attrs: {
35
36
...(data.attrs || {}),
36
37
id: props.id || null,
37
-
role: 'heading'
38
+
role: isTag(tag, 'header') ? null : 'heading'
38
39
},
39
40
ref: 'header'
40
41
},
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4