Skip to content

Commit d79df74

Browse files
marijohannessentw15egan
authored andcommitted
fix(unified-header): fixed keyboard event on the left nav link (#264)
1 parent ee81ddb commit d79df74

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/unified-header/left-nav.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class LeftNav extends mixin(createComponent, initComponentBySearch) {
220220
const childItem = eventMatches(evt, this.options.selectorLeftNavNestedListItem);
221221
const hasChildren = eventMatches(evt, this.options.selectorLeftNavListItemHasChildren);
222222
const flyoutItem = eventMatches(evt, this.options.selectorLeftNavFlyoutItem);
223+
const hasLinkItem = !(leftNavItem.querySelector(this.options.selectorLeftNavListItemLink) === undefined);
223224
if (flyoutItem) {
224225
this.addActiveListItem(flyoutItem);
225226
} else if (childItem) {
@@ -234,6 +235,9 @@ class LeftNav extends mixin(createComponent, initComponentBySearch) {
234235
}
235236
} else if (hasChildren) {
236237
this.handleNestedListClick(leftNavItem);
238+
} else if (hasLinkItem) {
239+
const link = leftNavItem.querySelector(this.options.selectorLeftNavListItemLink);
240+
link.click();
237241
} else {
238242
this.addActiveListItem(leftNavItem);
239243
}

src/components/unified-header/unified-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
</ul>
281281
</li>
282282
<li role="menuitem" class="bx--main-nav__parent-item" data-left-nav-item tabindex="0">
283-
<a class="bx--parent-item__link" href="#" title="Example Item" tabindex="-1" aria-haspopup="true" data-left-nav-item-link>
283+
<a class="bx--parent-item__link" href="#" title="Example Item" tabindex="-1" data-left-nav-item-link>
284284
<svg class="bx--parent-item__link--taxonomy-icon">
285285
<use xlink:href="/carbon-icons/bluemix-icons.svg#icon--apps"></use>
286286
</svg>

0 commit comments

Comments
 (0)