Skip to content

Commit

Permalink
fix(NcActions): Detect navigation menu links correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Oct 28, 2023
1 parent 9be837d commit 0fb1ead
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,11 @@ export default {

const isNavLink = (action) => {
const componentName = action?.componentOptions?.Ctor?.extendOptions?.name ?? action?.componentOptions?.tag
const href = action?.componentOptions?.propsData?.href
return (
componentName === 'NcActionLink'
&& action?.componentOptions?.propsData?.href?.startsWith(window.location.origin)
&& !href.startsWith('#')
&& new URL(href, window.location.origin).origin === window.location.origin
)
}
// Automatically detect whether all actions are website navigation links
Expand Down

0 comments on commit 0fb1ead

Please sign in to comment.