Skip to content

Commit

Permalink
Add target prop for NcListItem
Browse files Browse the repository at this point in the history
The component user should have full control over what tab
 they want the link to open in, if any.

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe committed Dec 6, 2023
1 parent 8008811 commit 4f307ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/NcListItem/NcListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
<a :id="anchorId"
ref="list-item"
:href="routerLinkHref || href"
:target="href === '#' ? undefined : '_blank'"
:target="target || (href === '#' ? undefined : '_blank')"
:rel="href === '#' ? undefined : 'noopener noreferrer'"
class="list-item"
:aria-label="linkAriaLabel"
Expand Down Expand Up @@ -470,6 +470,11 @@ export default {
default: '#',
},
target: {

Check warning on line 473 in src/components/NcListItem/NcListItem.vue

View workflow job for this annotation

GitHub Actions / eslint

Prop 'target' requires default value to be set
type: String,
required: false,
},
/**
* Id for the `<a>` element
*/
Expand Down Expand Up @@ -585,7 +590,6 @@ export default {
computedActionsAriaLabel() {
return this.actionsAriaLabel || t('Actions for item with name "{name}"', { name: this.name })
},
},
watch: {
Expand Down

0 comments on commit 4f307ec

Please sign in to comment.