Skip to content

Commit 8ab436e

Browse files
authored
fix(HeaderMenu): spread extra props into root element (#9139)
* fix(HeaderMenu): spread extra props into root element * test(HeaderMenu): update test description * fix(HeaderMenu): destructure focusRef * chore: update snapshots
1 parent 3c116e9 commit 8ab436e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

packages/react/src/components/UIShell/HeaderMenu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ class HeaderMenu extends React.Component {
173173
children,
174174
renderMenuContent: MenuContent,
175175
menuLinkName,
176+
focusRef, // eslint-disable-line no-unused-vars
177+
...rest
176178
} = this.props;
177179
const accessibilityLabel = {
178180
'aria-label': ariaLabel,
@@ -188,6 +190,7 @@ class HeaderMenu extends React.Component {
188190
// - href can be set to javascript:void(0), ideally this will be a button
189191
return (
190192
<li // eslint-disable-line jsx-a11y/mouse-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions
193+
{...rest}
191194
className={className}
192195
onKeyDown={this.handleMenuClose}
193196
onClick={this.handleOnClick}

packages/react/src/components/UIShell/__tests__/HeaderMenu-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('HeaderMenu', () => {
9595
});
9696

9797
describe('menu button interactions', () => {
98-
it('should should open and close', () => {
98+
it('should open and close', () => {
9999
const wrapper = mount(
100100
<HeaderMenu {...mockProps}>
101101
<HeaderMenuItem href="/a">A</HeaderMenuItem>

packages/react/src/components/UIShell/__tests__/__snapshots__/HeaderMenu-test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ exports[`HeaderMenu should render 1`] = `
5858
onBlur={[Function]}
5959
onClick={[Function]}
6060
onKeyDown={[Function]}
61+
tabIndex={-1}
6162
>
6263
<a
6364
aria-expanded={false}

0 commit comments

Comments
 (0)