From b5d80d138213a8af7b8f1fddb8f55b9780899d8a Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Thu, 2 Aug 2018 17:19:35 -0700 Subject: [PATCH 1/2] Menu supports HTML attributes --- packages/core/src/components/menu/menu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/menu/menu.tsx b/packages/core/src/components/menu/menu.tsx index b78c071692..7b77bf18de 100644 --- a/packages/core/src/components/menu/menu.tsx +++ b/packages/core/src/components/menu/menu.tsx @@ -12,7 +12,7 @@ import { DISPLAYNAME_PREFIX, IProps } from "../../common/props"; import { MenuDivider } from "./menuDivider"; import { MenuItem } from "./menuItem"; -export interface IMenuProps extends IProps { +export interface IMenuProps extends IProps, React.HTMLAttributes { /** Whether the menu items in this menu should use a large appearance. */ large?: boolean; @@ -29,7 +29,7 @@ export class Menu extends React.Component { public render() { const classes = classNames(Classes.MENU, { [Classes.LARGE]: this.props.large }, this.props.className); return ( -
    +
      {this.props.children}
    ); From a4205d3a23599b20a2fe245f4df4daed29538bcf Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Thu, 2 Aug 2018 17:20:53 -0700 Subject: [PATCH 2/2] remove invalid html props --- packages/core/src/components/menu/menu.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/components/menu/menu.tsx b/packages/core/src/components/menu/menu.tsx index 7b77bf18de..990f7e61b6 100644 --- a/packages/core/src/components/menu/menu.tsx +++ b/packages/core/src/components/menu/menu.tsx @@ -27,10 +27,11 @@ export class Menu extends React.Component { public static Item = MenuItem; public render() { - const classes = classNames(Classes.MENU, { [Classes.LARGE]: this.props.large }, this.props.className); + const { className, children, large, ulRef, ...htmlProps } = this.props; + const classes = classNames(Classes.MENU, { [Classes.LARGE]: large }, className); return ( -
      - {this.props.children} +
        + {children}
      ); }