Skip to content

Minor fixes and improvements in the CAccordion and CNavGroup component #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(CNavGroup): add the missing href attribute to the toggler
  • Loading branch information
mrholek committed Jan 7, 2025
commit 7a65f3674bca057e74196736d8d052f7c765034b
9 changes: 7 additions & 2 deletions packages/coreui-vue/src/components/nav/CNavGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const CNavGroup = defineComponent({

onMounted(() => {
visible.value = props.visible
props.visible && navGroupRef.value.classList.add('show')
if (props.visible) {
navGroupRef.value.classList.add('show')
}

emit('visible-change', visible.value)
})

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

const handleTogglerClick = () => {
const handleTogglerClick = (event: Event) => {
event.preventDefault()
visible.value = !visible.value
emit('visible-change', visible.value)
}
Expand Down Expand Up @@ -111,6 +115,7 @@ const CNavGroup = defineComponent({
'a',
{
class: ['nav-link', 'nav-group-toggle'],
href: '#',
onClick: handleTogglerClick,
},
slots.togglerContent && slots.togglerContent(),
Expand Down