Skip to content

onClick is not triggered correctly in MenuItem #387

@UBy

Description

@UBy

I Haven't been able to add a workable onClick callback for a menu item in the LeftNav component.

when I do some debugging in menu-item.js, like this:

_handleOnClick: function(e) {
console.log(this.props.onClick); <----- debug
if (this.props.onClick) this.props.onClick(e, this.props.index);
}

I get the following in the console:
function () { [native code] }

But for some reason the function does nothing when called, not even alert() or console.log()

I have tested it like this:

 menuItems: [
 { route: 'eee', text: '123', iconRightClassName: "md-list"},
 { route: 'get-started', text: 'Get Started', iconClassName: "md-file-upload", onClick:function(ev, index) { console.log("123");} },
     ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: menuChanges related to the menu.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions