Skip to content

Commit 7a65f36

Browse files
committed
fix(CNavGroup): add the missing href attribute to the toggler
1 parent 8c28277 commit 7a65f36

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/coreui-vue/src/components/nav/CNavGroup.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ const CNavGroup = defineComponent({
4141

4242
onMounted(() => {
4343
visible.value = props.visible
44-
props.visible && navGroupRef.value.classList.add('show')
44+
if (props.visible) {
45+
navGroupRef.value.classList.add('show')
46+
}
47+
4548
emit('visible-change', visible.value)
4649
})
4750

@@ -60,7 +63,8 @@ const CNavGroup = defineComponent({
6063
emit('visible-change', visible.value)
6164
})
6265

63-
const handleTogglerClick = () => {
66+
const handleTogglerClick = (event: Event) => {
67+
event.preventDefault()
6468
visible.value = !visible.value
6569
emit('visible-change', visible.value)
6670
}
@@ -111,6 +115,7 @@ const CNavGroup = defineComponent({
111115
'a',
112116
{
113117
class: ['nav-link', 'nav-group-toggle'],
118+
href: '#',
114119
onClick: handleTogglerClick,
115120
},
116121
slots.togglerContent && slots.togglerContent(),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy