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 · 12 comments

Comments

Projects
None yet
6 participants
@zhayes

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

This comment has been minimized.

ant-design-bot commented Dec 13, 2017

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.

@zhayes

This comment has been minimized.

zhayes commented Dec 13, 2017

@afc163

This comment has been minimized.

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 Dec 13, 2017

@afc163 afc163 reopened this Dec 13, 2017

@zhayes

This comment has been minimized.

zhayes commented Dec 13, 2017

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

@afc163

This comment has been minimized.

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🐛 label Dec 13, 2017

@zhayes

This comment has been minimized.

zhayes commented Dec 13, 2017

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

@zhayes

This comment has been minimized.

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

This comment has been minimized.

zhayes commented Dec 13, 2017

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

@wanghqwe

This comment has been minimized.

wanghqwe commented Feb 27, 2018

The latest version of this problem remains unsolved

@treasureDouDou

This comment has been minimized.

treasureDouDou commented Mar 31, 2018

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

@wjkang

This comment has been minimized.

wjkang commented May 31, 2018

3.5.3 仍然有这个问题

@wjkang

This comment has been minimized.

wjkang commented May 31, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment