Skip to content

SubMenu doesn't actually support itemIcon like docs suggest #283

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

Closed
alibosworth opened this issue Sep 19, 2019 · 2 comments
Closed

SubMenu doesn't actually support itemIcon like docs suggest #283

alibosworth opened this issue Sep 19, 2019 · 2 comments

Comments

@alibosworth
Copy link

in SubMenu.jsx, "itemIcon" is defined as a prop, however only expandIcon is actually rendered:

   // expand custom icon should NOT be displayed in menu with horizontal mode.
    let icon = null;
    if (props.mode !== 'horizontal') {
      icon = this.props.expandIcon; // ReactNode
      if (typeof this.props.expandIcon === 'function') {
        icon = React.createElement(
          this.props.expandIcon,
          { ...this.props }
        );
      }
    }

    const title = (
      <div
        ref={this.saveSubMenuTitle}
        style={style}
        className={`${prefixCls}-title`}
        {...titleMouseEvents}
        {...titleClickEvents}
        aria-expanded={isOpen}
        {...ariaOwns}
        aria-haspopup="true"
        title={typeof props.title === 'string' ? props.title : undefined}
      >
        {props.title}
        {icon || <i className={`${prefixCls}-arrow`} />}
      </div>
    );
@Michael101sh
Copy link

@picodoth @yiminghe @afc163 @zombieJ Can you please fix it?

@zombieJ
Copy link
Member

zombieJ commented Aug 25, 2020

icon prop added 4.2.0. Pls use this instead:

https://ant.design/components/menu/#Menu.SubMenu

@zombieJ zombieJ closed this as completed Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants