Skip to content

Commit

Permalink
fix: ensure that footer replacing js is always executed on attach
Browse files Browse the repository at this point in the history
  • Loading branch information
mlopezFC authored and javier-godoy committed Oct 4, 2024
1 parent b028337 commit 62549e6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,10 @@ public Component getHeaderComponent() {
*/
public void setFooterComponent(Component component) {
Objects.requireNonNull(component, "Component cannot not be null");
if (footerComponent==null) {
this.getElement().executeJs("setTimeout(() => this.shadowRoot.querySelector($0).innerHTML = $1)", ".chat-footer", "<slot name='footer'></slot>");
} else {
if (footerComponent!=null) {
this.footerContainer.remove(footerComponent);
}
this.getElement().executeJs("setTimeout(() => this.shadowRoot.querySelector($0).innerHTML = $1)", ".chat-footer", "<slot name='footer'></slot>");
this.footerComponent = component;
footerContainer.add(footerComponent);
}
Expand Down

0 comments on commit 62549e6

Please sign in to comment.