Avoid that comments autoclose.
Change 343814 introduced a patched version of the html operator that
guarantees that the strings template remains the same across multiple
invocations. Lit relies on this to determine whether or not to recreate
a node.
That being said, it was not applied on all `html` stanzas that
eventually contain comments. Hopefully adding this should mitigate the
issue, but without the ability to replicate the issue it is hard to
confirm.
Google-Bug-Id: b/228974289
Release-Notes: skip
Change-Id: Ief18bc3d854561222ea166ffc6c8ecf8cb7f7e1a
diff --git a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
index 78a1509..eb9dc41 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
@@ -452,7 +452,7 @@
unresolved: this.unresolved,
saving: this.saving,
};
- return html`
+ return this.patched.html`
${this.renderFilePath()}
<div id="container">
<h3 class="assistive-tech-only">${this.computeAriaHeading()}</h3>
@@ -504,7 +504,7 @@
// because we ran into spurious issues with <gr-comment> being destroyed
// and re-created when an unsaved draft transitions to 'saved' state.
const draftComment = this.renderComment(this.getDraftOrUnsaved());
- return html`${publishedComments}${draftComment}`;
+ return this.patched.html`${publishedComments}${draftComment}`;
}
private renderComment(comment?: Comment) {