Replies: 1 comment
-
class PasswordField extends LitElement {
value = '';
static properties = {
value: { type: String }
}
updateValue() {
this.value = this.renderRoot?.querySelector('input')?.value || '';
}
render() {
return html`<div class="container">
<input type="password" .value=${this.value} @input=${this.updateValue} />
</div>`;
}
}
const password = this.querySelector('password-field')?.value |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jkaan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I might be making this more complex than it has to be but I can't figure it out.
I have a simple component called PasswordField like:
I use this component in another file like:
Now I'm interested in the value of the input type of the password-field, how would I go about getting that value out (possibly reactive so I can have the current value always up to date)?
Beta Was this translation helpful? Give feedback.
All reactions