Skip to content

Commit 26f3553

Browse files
committed
fixup! Bring back keyboard navigation
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 79ecd9a commit 26f3553

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/components/NcListItem/NcListItem.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@
338338
@mouseleave="handleMouseleave"
339339
@focus="handleFocus"
340340
@blur="handleBlur"
341-
@keydown.tab.exact="handleTab"
342341
@click="onClick($event, navigate, routerLinkHref)"
342+
@keydown.enter="onClick($event, navigate, routerLinkHref)"
343+
@keydown.tab.exact="handleTab"
343344
@keydown.esc="hideActions">
344345
<div :class="['list-item-content__wrapper', {
345346
'list-item-content__wrapper--compact': compact
@@ -354,7 +355,8 @@
354355
:aria-label="linkAriaLabel"
355356
:href="routerLinkHref || href"
356357
:target="target || (href === '#' ? undefined : '_blank')"
357-
:rel="href === '#' ? undefined : 'noopener noreferrer'">
358+
:rel="href === '#' ? undefined : 'noopener noreferrer'"
359+
@click.stop="onClick($event, navigate, routerLinkHref)">
358360
<div class="list-item-content__main"
359361
:class="{ 'list-item-content__main--oneline': oneLine }">
360362

@@ -619,7 +621,7 @@ export default {
619621
/**
620622
* Handle link click
621623
*
622-
* @param {PointerEvent} event - Native click event
624+
* @param {MouseEvent|KeyboardEvent} event - Native click or keydown event
623625
* @param {Function} [navigate] - VueRouter link's navigate if any
624626
* @param {string} [routerLinkHref] - VueRouter link's href
625627
*/
@@ -634,6 +636,8 @@ export default {
634636
if (routerLinkHref) {
635637
navigate?.(event)
636638
event.preventDefault()
639+
} else {
640+
window.location = this.href
637641
}
638642
},
639643

0 commit comments

Comments
 (0)