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

The sidebar shrinks and the menu still displays #8587

Closed
zhayes opened this issue Dec 13, 2017 · 13 comments
Closed

The sidebar shrinks and the menu still displays #8587

zhayes opened this issue Dec 13, 2017 · 13 comments
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 🤔 Need Reproduce We cannot reproduce your problem

Comments

@zhayes
Copy link

zhayes commented Dec 13, 2017

Version

3.0.1

Environment

antd @3.0.1

Reproduction link

https://ant.design/components/layout-cn/

Steps to reproduce

侧边栏收缩后,下拉菜单仍然显示到页面

What is expected?

侧边栏收缩后,下拉菜单同样消失

What is actually happening?

侧边栏收缩后,下拉菜单停留在页面
image

image

@ant-design-bot
Copy link
Contributor

Hello @zhayes. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Dec 13, 2017
@zhayes
Copy link
Author

zhayes commented Dec 13, 2017

@afc163
Copy link
Member

afc163 commented Dec 13, 2017

Menu will always respect openKeys prop, I think it is correct behavior. You can control it depends on different collapsed state.

@afc163 afc163 closed this as completed Dec 13, 2017
@afc163 afc163 reopened this Dec 13, 2017
@zhayes
Copy link
Author

zhayes commented Dec 13, 2017

@afc163 It's not going to happen in v2.3.1

@afc163
Copy link
Member

afc163 commented Dec 13, 2017

Alrough we should still hide the sub-menu because there is not suitable position for it when menu is collapsed to 0px.

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Dec 13, 2017
@zhayes
Copy link
Author

zhayes commented Dec 13, 2017

@afc163 I updated the version last night, and it happened

@zhayes
Copy link
Author

zhayes commented Dec 13, 2017

@afc163 I bound a method of onCollapse to Menu.Side.The problem has been solved for a while.

Cache re-empty

    const onCollapse=(collapsed, type) => {
        if(collapsed){
            this.setState({
                lastsideOpenkeys:this.state.sideOpenKeys,
                sideOpenKeys:[]
            })
        }else{
            this.setState({
                lastsideOpenkeys:[],
                sideOpenKeys:this.state.lastsideOpenkeys
            })
        }
    }

@zhayes
Copy link
Author

zhayes commented Dec 13, 2017

But it's not perfect !!!!!!!!!!!!!

@wanghqwe
Copy link

The latest version of this problem remains unsolved

@treasureDouDou
Copy link

这个问题的最新版本仍未解决 +1

@wjkang
Copy link

wjkang commented May 31, 2018

3.5.3 仍然有这个问题

@wjkang
Copy link

wjkang commented May 31, 2018

@zhayes 你好,请问你解决这个问题了吗?

@clearloop
Copy link

Warning: Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.

this warning while collapsedWidth={0}

"antd": "^3.18.1",
"react": "^16.8.6",
"react-dom": "^16.8.6"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

7 participants