Skip to content

Instantly share code, notes, and snippets.

@zindel
Created October 6, 2016 12:06
Show Gist options
  • Save zindel/fcd16317af555bcaf39c399e72bd0800 to your computer and use it in GitHub Desktop.
Save zindel/fcd16317af555bcaf39c399e72bd0800 to your computer and use it in GitHub Desktop.
diff --git a/src/topNav/PrimaryMenu.js b/src/topNav/PrimaryMenu.js
index 57efdfd..0229aa9 100644
--- a/src/topNav/PrimaryMenu.js
+++ b/src/topNav/PrimaryMenu.js
@@ -61,6 +61,7 @@ export class PrimaryMenu extends React.Component {
render() {
let {
children,
+ href,
items,
variant,
...props
@@ -69,9 +70,9 @@ export class PrimaryMenu extends React.Component {
return (
<VBox
{...props}
- onMouseEnter={this.onMouseEnter}
- onMouseLeave={this.onMouseLeave}>
- <PrimaryButton variant={{...variant, open}}>
+ onMouseEnter={items.length ? this.onMouseEnter : null}
+ onMouseLeave={items.length ? this.onMouseLeave : null}>
+ <PrimaryButton variant={{...variant, open}} href={href}>
{children}
</PrimaryButton>
{open &&
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment