material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

IconMenu, DropDownMenu not changing menus visibility state onClick

Open llcoole93 opened this issue 11 years ago • 1 comments

I am using material-ui exact implementation of both of these components in a sandboxed environment. For some reason the menus never become visible. This is my entire react component, I'm not sure if i have done something wrong here.

I can go into my console and set the visibility state to true on the drop downs and get them to show, But I can't click the DropDownMenu or IconMenu and have it work

** sorry for the ugly code

/* eslint-disable */ import React from 'react';

import { DropDownMenu, Styles, IconMenu, AppBar, IconButton, FontIcon } from 'material-ui'; import Logo from './Logo.jsx'; import LogoImage from './images/BrandLogoDesktop.png';

let Menu = require('../node_modules/material-ui/lib/menus/menu'); let MenuItem = require('../node_modules/material-ui/lib/menus/menu-item'); let MenuDivider = require('../node_modules/material-ui/lib/menus/menu-divider');

const themeManager = Styles.ThemeManager(); const menuItems = [ { payload: '1', text: 'Never' }, { payload: '2', text: 'Every Night' }, { payload: '3', text: 'Weeknights' }, { payload: '4', text: 'Weekends' }, { payload: '5', text: 'Weekly' }, ];

export default React.createClass({

childContextTypes: {
    muiTheme: React.PropTypes.object,
},

getChildContext() {
    return {
        muiTheme: themeManager.getCurrentTheme(),
    };
},
render() {
    const appbarHeader = (
  <Logo image={LogoImage} style="width: 100%" />
);
    return (
        <div>
            <AppBar 
                title="Catlyst"

                showMenuIconButton={false} />   
            <DropDownMenu menuItems={menuItems} />
            <IconMenu iconButtonElement={
                <IconButton tooltip="Dashboard">
                    <FontIcon className="material-icons">dashboard</FontIcon>
                </IconButton>}>
                <Menu>
                    <MenuItem primaryText="Maps" />
                    <MenuItem primaryText="Books" />
                    <MenuItem primaryText="Flights" />
                    <MenuItem primaryText="Apps" />
                </Menu>
            </IconMenu>
        </div>
    );
},
openDrop() {
    console.log('heythere');
},

});

llcoole93 avatar Aug 26 '15 18:08 llcoole93

I was able to fix this by deleting my externals in my webpack.config file. I am not sure how this worked but it did.

llcoole93 avatar Aug 27 '15 16:08 llcoole93