Skip to content

bug: reflected prop value forced to null when set to undefined #3586

@liamdebeasi

Description

@liamdebeasi

Prerequisites

Stencil Version

2.17.4

Current Behavior

Setting the value of a reflected property to undefined will cause Stencil to force the value to null instead.

Expected Behavior

I expect the value to be set to undefined.

Steps to Reproduce

  1. Clone repo.
  2. Run npm install.
  3. Run npm run start.
  4. Open dev tools. Observe that the fill property is logged as "outline".
  5. Click the "Set fill to undefined" button. Observe that the property is logged as undefined and then logged again as null.
  6. Remove reflect: true from the property decorator.
  7. Click the "Set fill to undefined" button. Observe that the property is only logged as undefined.

Code Reproduction URL

https://github.com/liamdebeasi/stencil-reflect-prop

Additional Information

This was found in ionic-team/ionic-framework#25886.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions