Skip to content

[nz-popconfirm] nzIcon type definition forbids null, preventing icon hiding despite template support #9554

@l-tagliareni

Description

@l-tagliareni

Currently, nzIcon on the nz-popconfirm directive is typed as string | TemplateRef<void>. This makes it impossible to pass null to hide the icon without triggering a TypeScript error.

Reproducible Example

<a
  nz-popconfirm
  nzPopconfirmTitle="Are you sure?"
  [nzIcon]="null"
>
  Delete
</a>

However, looking at the internal template implementation (file: /popconfirm.ts), there is a logic check specifically handling null values:

@if (nzIcon !== null) { ... }

Expected Behavior

The nzIcon input type should be updated to accept null so that the internal check @if (nzIcon !== null) can actually be utilized by consumers.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions