I'm using a vaadin-dialog in my Web Components app. I would like the components inside to render on properties change but they don't.
I have a couple properties in my web component:
static get properties() {
return {
title: { type: String },
username: { type: String },
signUpOpened: { type: Boolean },
};
}
The dialog is defined as such. I use a function to bind it to the DialogRenderer. The dialog shouldn't be always open, so the user clicks it to open it.
render() {
return html`
<main>
<h1>${this.title}</h1>
<vaadin-dialog
header-title="SignUp"
.opened="${this.signUpOpened}"
@opened-changed="${e => (this.signUpOpened = e.detail.value)}"
${dialogRenderer(this.signUpRenderer)}
id="signUp">
</vaadin-dialog>
</main>
`;
}
signUpRenderer() {
return html`
<vaadin-text-field value="${this.username}" @change="${(e) => {
this.username = e.target.value
}}" label="email"></vaadin-text-field>
<vaadin-text-field value="${this.username}" }}" label="email-copy"></vaadin-text-field>
<p>${this.username}</p>
`;
}
You can try the demo over here, the source code is here.
When changing the value of the text field, you can see that the other text field and the paragraph don't update.
Can you folks direct me towards what is going on?