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

nz-dropdown的二级菜单nz-submenu不会自动隐藏,版本:0.6.0-rc.2 #520

Closed
realmx opened this issue Nov 2, 2017 · 6 comments · Fixed by #552
Closed

nz-dropdown的二级菜单nz-submenu不会自动隐藏,版本:0.6.0-rc.2 #520

realmx opened this issue Nov 2, 2017 · 6 comments · Fixed by #552
Assignees

Comments

@realmx
Copy link

realmx commented Nov 2, 2017

  • 页面效果,鼠标已离开,但nz-submenu没有自动隐藏

96a8bf77-4f7a-4f1c-8ea9-bbbb0d846cc5

  • HTML预览,鼠标每次经过nz-submenu都会自动生成一个子ul

dba04a9650644638fcae10b3b12da30e

  • HTML Code
<nz-dropdown [nzPlacement]="'topCenter'">
    <button nz-button nz-dropdown [nzShape]="'circle'">
        <i class="anticon anticon-bars"></i>
    </button>
    <ul nz-menu>
        <li nz-submenu>
            <span title>submenu</span>
            <ul>
                <li nz-menu-item>
                    <a rel="noopener noreferrer">menu-item</a>
                </li>
                <li nz-menu-item>
                    <a rel="noopener noreferrer">menu-item</a>
                </li>
                <li nz-menu-item>
                    <a rel="noopener noreferrer">menu-item</a>
                </li>
            </ul>
        </li>
        <li nz-menu-divider></li>
        <li nz-menu-item>
            <a rel="noopener noreferrer">menu-item</a>
        </li>
        <li nz-menu-item>
            <a rel="noopener noreferrer">menu-item</a>
        </li>
        <li nz-menu-item>
            <a rel="noopener noreferrer">menu-item</a>
        </li>
    </ul>
</nz-dropdown>
  • "ng-zorro-antd": "^0.6.0-rc.2"

  • CLI Version

ng -v

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.5.0
Node: 6.11.3
OS: darwin x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.6.1
webpack: 3.8.1
@ghost
Copy link

ghost commented Nov 8, 2017

这个问题我也遇到了,当菜单收缩为icon时,鼠标hover效果出现叠加的子ul,期望效果是悬浮时只显示当前的子菜单(用的是最新版本的组件)
package.json如下:
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"core-js": "^2.4.1",
"ng-zorro-antd": "^0.6.0-rc.3",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
原因可能是因为在移动过程中重复产生新的dom的ul,并没有移除掉之前的ul

@ghost
Copy link

ghost commented Nov 8, 2017

解决方案:执行npm install @angular/[email protected]版本(用angular4.2.4)
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"core-js": "^2.4.1",
"ng-zorro-antd": "^0.6.0-rc.3",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},

@realmx

@realmx
Copy link
Author

realmx commented Nov 9, 2017

@15136133225 感谢解答,可是4.x版本编译很慢哎,目前我坚持用着5.0,因为影响不是很严重,等版本更新吧,希望能快一点

@superestze
Copy link

5.0以上的版本也没有解决这个问题呀。在A页面点击nz-drowndown 的menu, 跳转到B页面, nz-dropdown也会出现menu

@realmx
Copy link
Author

realmx commented Mar 7, 2018

@superestze 看来你得重新开个issue

@lock
Copy link

lock bot commented Mar 7, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 7, 2019
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants