diff --git a/web-common/src/components/button/Button.svelte b/web-common/src/components/button/Button.svelte index 9ed809d3c77..48987320d34 100644 --- a/web-common/src/components/button/Button.svelte +++ b/web-common/src/components/button/Button.svelte @@ -1,7 +1,8 @@ + + diff --git a/web-common/src/components/forms/InputV2.svelte b/web-common/src/components/forms/InputV2.svelte index 51c5e1eafe9..310eda15aae 100644 --- a/web-common/src/components/forms/InputV2.svelte +++ b/web-common/src/components/forms/InputV2.svelte @@ -21,6 +21,12 @@ inputElement.focus(); }); } + + function handleKeyDown(event: KeyboardEvent) { + if (event.key === "Enter") { + event.preventDefault(); + } + }
@@ -45,6 +51,7 @@ bind:value on:input on:change + on:keydown={handleKeyDown} {id} name={id} type="text" diff --git a/web-common/src/components/icons/Trash.svelte b/web-common/src/components/icons/Trash.svelte new file mode 100644 index 00000000000..90f5392baee --- /dev/null +++ b/web-common/src/components/icons/Trash.svelte @@ -0,0 +1,20 @@ + + + + + diff --git a/web-common/src/features/dashboards/scheduled-reports/CreateScheduledReportModal.svelte b/web-common/src/features/dashboards/scheduled-reports/CreateScheduledReportModal.svelte index ad0df053386..c36addb1cc9 100644 --- a/web-common/src/features/dashboards/scheduled-reports/CreateScheduledReportModal.svelte +++ b/web-common/src/features/dashboards/scheduled-reports/CreateScheduledReportModal.svelte @@ -1,6 +1,9 @@ @@ -206,27 +201,37 @@ optional placeholder="1000" /> -
-
- - - -
+ { + $form["recipients"] = $form["recipients"].concat({ email: "" }); + recipientErrors = recipientErrors.concat({ email: "" }); + + // Focus on the new input element + setTimeout(() => { + const input = document.getElementById( + `recipients.${$form["recipients"].length - 1}.email` + ); + input?.focus(); + }, 0); + }} + on:remove-item={(event) => { + const index = event.detail.index; + $form["recipients"] = $form["recipients"].filter((r, i) => i !== index); + recipientErrors = recipientErrors.filter((r, i) => i !== index); + }} + /> -
+
{#if $createReport.isError}
{$createReport.error.message}
{/if} @@ -235,7 +240,8 @@ Cancel