Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(HeaderMenu): spread extra props into root element #9139

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/react/src/components/UIShell/HeaderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ class HeaderMenu extends React.Component {
children,
renderMenuContent: MenuContent,
menuLinkName,
focusRef, // eslint-disable-line no-unused-vars
...rest
} = this.props;
const accessibilityLabel = {
'aria-label': ariaLabel,
Expand All @@ -188,6 +190,7 @@ class HeaderMenu extends React.Component {
// - href can be set to javascript:void(0), ideally this will be a button
return (
<li // eslint-disable-line jsx-a11y/mouse-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions
{...rest}
className={className}
onKeyDown={this.handleMenuClose}
onClick={this.handleOnClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('HeaderMenu', () => {
});

describe('menu button interactions', () => {
it('should should open and close', () => {
it('should open and close', () => {
const wrapper = mount(
<HeaderMenu {...mockProps}>
<HeaderMenuItem href="/a">A</HeaderMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports[`HeaderMenu should render 1`] = `
onBlur={[Function]}
onClick={[Function]}
onKeyDown={[Function]}
tabIndex={-1}
>
<a
aria-expanded={false}
Expand Down