NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.81k stars 3.86k forks source link

nz-popover closes when it's showed on hover and we hover the dropdown menu of a select component #8123

Open YoBou opened 9 months ago

YoBou commented 9 months ago

Reproduction link

https://stackblitz.com/edit/angular-tru7hd-xqtrkw?file=src%2Fapp%2Fapp.component.ts,src%2Findex.html

Steps to reproduce

What is expected?

Popover stay visible and we can click on the select choice

What is actually happening?

Popover disappears

Environment Info
ng-zorro-antd 16.2.0
Browser Firefox, Edge
cxb1021 commented 9 months ago

you can try nzPopoverTrigger="click"

YoBou commented 9 months ago

you can try nzPopoverTrigger="click"

In this case yes, but sadly in my real use case I can't. The button's click have already a behavior. I don't want to show the popup on click

cxb1021 commented 9 months ago

you can try nzPopoverTrigger="click"

In this case yes, but sadly in my real use case I can't. The button's click have already a behavior. I don't want to show the popup on click

If you cannot use click, the only way i can think of is to get nz-popover directive instance and manually control visibility. not sure if it's doable, just an idea

YoBou commented 9 months ago

you can try nzPopoverTrigger="click"

In this case yes, but sadly in my real use case I can't. The button's click have already a behavior. I don't want to show the popup on click

If you cannot use click, the only way i can think of is to get nz-popover directive instance and manually control visibility. not sure if it's doable, just an idea

Yeah I tried but it's quickly a hard task to manage and honestly I used a framework to avoid this :). But thanks for the source link, I'll take a look on it. Are you agree that's look like a bug or it's normal ? I don't know how this behavior is managed in other GUI framework so I don't know if my use case is standard or not.

cxb1021 commented 9 months ago

you can try nzPopoverTrigger="click"

In this case yes, but sadly in my real use case I can't. The button's click have already a behavior. I don't want to show the popup on click

If you cannot use click, the only way i can think of is to get nz-popover directive instance and manually control visibility. not sure if it's doable, just an idea

Yeah I tried but it's quickly a hard task to manage and honestly I used a framework to avoid this :). But thanks for the source link, I'll take a look on it. Are you agree that's look like a bug or it's normal ? I don't know how this behavior is managed in other GUI framework so I don't know if my use case is standard or not.

i think this behaviour is a little problematic. you can check out the react version of ant design, that version is more reasonable.