Skip to content

Commit

Permalink
Cleanup of the NcAppNavigationItem onClick handler
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Feb 27, 2023
1 parent c2e4fc2 commit 4ce516e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/NcAppNavigationItem/NcAppNavigationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Just set the `pinned` prop.
:target="isExternal(href) ? '_blank' : ''"
:title="title || nameTitleFallback"
@blur="handleBlur"
@click="(event) => { onClick(event); navigate(event) }"
@click="(event) => onClick(event, navigate)"
@focus="handleFocus"
@keydown.tab.exact="handleTab">

Expand Down Expand Up @@ -648,7 +648,9 @@ export default {
},
// forward click event
onClick(event) {
onClick(event, navigate) {
// Navigate is only defined if it is a router-link
navigate?.()
this.$emit('click', event)
},
Expand Down

0 comments on commit 4ce516e

Please sign in to comment.