-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Which package(s) are affected?
Lit Core (lit / lit-html / lit-element / reactive-element)
Description
Reactive properties defined via the static properties block v. the property decorator can have inconsistent initial changed values.
This is true for example, for properties defined via accessor or via custom get/set.
Reproduction
https://lit.dev/playground/#gist=9ea51856fe6b624f8dc1d37b62692dd4
See console output. All the of *j and *t properties should match.
Workaround
Hack fix:
static createProperty(name, options) {
if (this.prototype.hasOwnProperty(name)) {
options = {...options, wrapped: true};
}
super.createProperty(name, options);
}
_$changeProperty(name, oldValue, options) {
oldValue = this.hasUpdated ? oldValue : undefined;
super._$changeProperty(name, oldValue, options);
}Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
3.2.1
Browser/OS/Node environment
All
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done