Skip to content

Commit

Permalink
Merge pull request #2227 from nextcloud/backport/2220/stable4
Browse files Browse the repository at this point in the history
[stable4] Disable actions when the only action is disabeld
  • Loading branch information
GretaD authored Sep 10, 2021
2 parents 34185ce + c8b6fb1 commit 1c31b0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default {
[firstActionClass]: firstActionClass }"
class="action-item action-item--single"
rel="noreferrer noopener"
:disabled="disabled"
:disabled="isDisabled"
@focus="onFocus"
@blur="onBlur"
@[firstActionEventBinding]="execFirstAction">
Expand Down Expand Up @@ -386,6 +386,10 @@ export default {
return this.actions.length === 1
&& this.firstActionElement !== null
},
isDisabled() {
return this.disabled
|| (this.actions.length === 1 && this.firstAction?.$props?.disabled)
},
/**
* First action vnode
* @returns {Object} return the first action vue vnode
Expand Down

0 comments on commit 1c31b0d

Please sign in to comment.