-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not re-render when setting sync property to same value #8223
fix: do not re-render when setting sync property to same value #8223
Conversation
66e84db
to
9e08816
Compare
@@ -105,7 +106,7 @@ const PolylitMixinImplementation = (superclass) => { | |||
this.requestUpdate(name, oldValue, options); | |||
|
|||
// Enforce synchronous update | |||
if (this.hasUpdated) { | |||
if (notEqual(oldValue, value) && this.hasUpdated) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Lit supports customizing property change detection with hasChanged. However, I decided that adding it to PolylitMixin is not useful since Polymer doesn't support this feature anyway.
Some of the failures make sense – they reveal that certain properties lack web-components/packages/overlay/src/vaadin-overlay-mixin.js Lines 17 to 28 in 9e08816
|
18569ff
to
f81d99a
Compare
1616a5e
to
c1f4599
Compare
3995a63
to
08ba456
Compare
|
if (!entry.target.isConnected) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related? Couldn't find which package is affected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I noticed, some tests finish before the resize observer processes the changes they triggered (at least setTimeout adds a delay). If the observer does something that triggers a Lit update, Lit throws an exception because the element no longer exists by that moment. This exception only appears in the logs and doesn't cause a failure because the test has already finished. Let me know if you would like me to exclude this change from the scope of this PR.
Description
Reassigning a sync property to the same value should not trigger a Lit re-render.
Fixes #8221
Type of change