X Tutup
Skip to content

Directives: [style.height.px]="contentHeight" leaves a value even if contentHeight is nulled #5110

@matanlurey

Description

@matanlurey

Assume the following template:

<div [style.height.px]="contentHeight"></div>

When contentHeight is 100:

<div style="height: 100px"></div>

When contentHeight is 0:

<div style="height: 0px"></div>

However, when contentHeight transitions from a non-null value to null/undefined...

Expected:

<div style=""></div>

Actual:

<!-- Either 0 or whatever the previous value was -->
<div style="height: 0px"></div>

@vsavkin Is this possibly CD related?

Workaround is to use [style.height] and manage your own String.

Metadata

Metadata

Assignees

Labels

area: commonIssues related to APIs in the @angular/common packagetype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup