Skip to content

Commit

Permalink
fix(UIShell): replace "javascript:void(0)" href value in HeaderMenu (#…
Browse files Browse the repository at this point in the history
…4354)

Replace "javascript:void(0)" href value with "#".
  • Loading branch information
Eric Liu authored and asudoh committed Oct 17, 2019
1 parent 42d1e19 commit 24e2a21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/react/src/components/UIShell/HeaderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class HeaderMenu extends React.Component {
/**
* Toggle the expanded state of the menu on click.
*/
handleOnClick = () => {
handleOnClick = e => {
e.preventDefault();

this.setState(prevState => ({
expanded: !prevState.expanded,
}));
Expand Down Expand Up @@ -180,7 +182,7 @@ class HeaderMenu extends React.Component {
aria-haspopup="menu" // eslint-disable-line jsx-a11y/aria-proptypes
aria-expanded={this.state.expanded}
className={`${prefix}--header__menu-item ${prefix}--header__menu-title`}
href="javascript:void(0)"
href="#"
onKeyDown={this.handleOnKeyDown}
ref={this.handleMenuButtonRef}
role="menuitem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`HeaderMenu should render 1`] = `
aria-expanded={false}
aria-haspopup="menu"
className="bx--header__menu-item bx--header__menu-title"
href="javascript:void(0)"
href="#"
onKeyDown={[Function]}
role="menuitem"
tabIndex={0}
Expand Down

0 comments on commit 24e2a21

Please sign in to comment.