Skip to content
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

Bug? LeftNav route not working. #583

Closed
mewben opened this issue Apr 26, 2015 · 4 comments
Closed

Bug? LeftNav route not working. #583

mewben opened this issue Apr 26, 2015 · 4 comments
Labels
component: menu This is the name of the generic UI component, not the React module!

Comments

@mewben
Copy link

mewben commented Apr 26, 2015

http://material-ui.com/#/components/left-nav

The routes get-started, css-framework and components didn't do anything.

@afhammad
Copy link

Hi mewben, I found this confusing too. The route attribute isn't actually a property, you could call it anything you want. You need to handle this in the onChange callback: (see https://github.com/callemall/material-ui/blob/2eb14e69c411e9165d696df1a88d4ac8036591bf/docs/src/app/components/app-left-nav.jsx#L56)

Alternatively you can use the LINK menu item type and pass in the url like shown in the doc you linked.

@mewben
Copy link
Author

mewben commented Apr 29, 2015

Ahh.. I see.. Thanks @afhammad

@mewben mewben closed this as completed Apr 29, 2015
@ayozebarrera
Copy link

I'm having a problem with this... the callback onChange never fires.... why?

I followed the docs aswell having:

Component

<LeftNav
  ref="leftNav"
  docked={true}
  isInitiallyOpen={false}
  header={header}
  menuItems={menuItems}
  selectedIndex={this._getSelectedIndex()}
  onChange={this._onLeftNavChange} />

_onLeftNavChange function

_onLeftNavChange(e, key, payload) {
  this.context.router.transitionTo(payload.route);
}

but the _onLeftNavChange never fires.. what's my mistake?

thanks

@ayozebarrera
Copy link

Nevermind.

I forgot the injectTapEventPlugin(); ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

5 participants