-
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:popover): add
nzPopoverOverlayClickable
to disable clic…
…k on mask (#8878)
- Loading branch information
1 parent
9ecbb29
commit 5898da7
Showing
8 changed files
with
117 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` 为 `false` 禁止通过点击蒙层关闭面板。 | ||
|
||
## en-US | ||
|
||
Set `nzPopoverOverlayClickable` to be `false` to disable closing popover by clicking the mask when `nzPopoverTrigger` is `'click'`. |
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,33 @@ | ||
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', | ||
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.