Skip to content

Commit

Permalink
Merge pull request #4160 from nextcloud/backport/4084/stable7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pytal committed May 26, 2023
2 parents 63480e8 + b5da357 commit 7975e64
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/NcActions/NcActions.vue
Expand Up @@ -960,6 +960,16 @@ export default {
action => action?.componentOptions?.tag || action?.componentOptions?.Ctor?.extendOptions?.name
)
const isNavLink = (action) => {
const componentName = action?.componentOptions?.Ctor?.extendOptions?.name ?? action?.componentOptions?.tag
return (
componentName === 'NcActionLink'
&& action?.componentOptions?.propsData?.href?.startsWith(window.location.origin)
)
}
// Automatically detect whether all actions are website navigation links
const isNav = actions.every(isNavLink)
/**
* Filter and list actions that are allowed to be displayed inline
*/
Expand Down Expand Up @@ -1093,7 +1103,7 @@ export default {
slot: 'trigger',
ref: 'menuButton',
attrs: {
'aria-haspopup': 'menu',
'aria-haspopup': isNav ? null : 'menu',
'aria-label': this.ariaLabel,
'aria-controls': this.opened ? this.randomId : null,
'aria-expanded': this.opened.toString(),
Expand Down Expand Up @@ -1123,7 +1133,7 @@ export default {
attrs: {
id: this.randomId,
tabindex: '-1',
role: 'menu',
role: isNav ? null : 'menu',
},
}, [
actions,
Expand Down

0 comments on commit 7975e64

Please sign in to comment.