首页 > 解决方案 > 选项卡显示在抽屉中,但没有发生切换

问题描述

https://codesandbox.io/s/1qlpxx34v3

 handleChange = (event, value) => {
    console.log("switch tabs drager ui--->");
    this.setState({ value });
  };


  <Tabs
            value={value}
            onChange={this.handleChange}
            scrollable
            scrollButtons="on"
            indicatorColor="primary"
            textColor="primary"
          >
            <Tab label="Item One" icon={<PhoneIcon />} />
            <Tab label="Item Two" icon={<FavoriteIcon />} />

          </Tabs>

标签: javascripthtmlreactjsreduxmaterial-ui

解决方案


On line 222 in tab-demo.js, I commented out this line:

onClick={this.toggleDrawer("right", false)}

Because with that line, every time you click inside the drawer, it will close.


推荐阅读