Web-components: Fix Form template component

This commit is contained in:
Michael Shilman 2022-09-30 21:55:01 +08:00
parent cd175660ba
commit 460c182da2

View File

@ -25,7 +25,8 @@ export class SbForm extends LitElement {
this.complete = false;
}
onSubmit() {
onSubmit(event) {
event.preventDefault();
const options = {
bubbles: true,
composed: true,
@ -55,11 +56,12 @@ export class SbForm extends LitElement {
@change=${(event) => {
event.preventDefault();
this.value = event.target.value;
return false;
}}
/>
</label>
<button type="submit">Submit</button>
${this.complete && '<p>Completed!!</p>'}
${this.complete ? 'Completed!!' : ''}
</form>
`;
}