-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:cdkconnectedoverlay): supports disabling click on mask
- Loading branch information
OriginRing
committed
Dec 11, 2024
1 parent
2e0c78d
commit a1a6c2a
Showing
8 changed files
with
118 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 8 | ||
title: | ||
zh-CN: 禁止通过蒙层关闭面板 | ||
en-US: Disable closing popover through mask | ||
--- | ||
|
||
## zh-CN | ||
|
||
通过设置 `nzPopoverTrigger="click",[nzPopoverOverlayClickable]="fales"` 禁止通过蒙层关闭面板 | ||
|
||
## en-US | ||
|
||
`nzPopoverTrigger="click",[nzPopoverOverlayClickable]="fales"` Disable closing popover through mask. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { NzButtonModule } from 'ng-zorro-antd/button'; | ||
import { NzPopoverModule } from 'ng-zorro-antd/popover'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-popover-overlay', | ||
standalone: true, | ||
imports: [NzButtonModule, NzPopoverModule], | ||
template: ` | ||
<button | ||
nz-button | ||
nz-popover | ||
nzType="primary" | ||
nzPopoverTitle="Title" | ||
nzPopoverTrigger="click" | ||
[nzPopoverContent]="contentTemplate" | ||
[nzPopoverOverlayClickable]="false" | ||
[nzPopoverVisible]="visible" | ||
(nzPopoverVisibleChange)="visibleChange($event)" | ||
>Click me</button | ||
> | ||
<ng-template #contentTemplate> | ||
<button nz-button nzSize="small" nzType="primary" (click)="visibleChange(false)"> Close me </button> | ||
</ng-template> | ||
` | ||
}) | ||
export class NzDemoPopoverOverlayComponent { | ||
visible = false; | ||
|
||
visibleChange(value: boolean): void { | ||
this.visible = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.