Skip to content

Commit

Permalink
Avoid issue creation without title or description
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez committed Dec 13, 2024
1 parent ca4d9d1 commit 5f26f71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/ExtendedTextarea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
body?: string;
embeds?: Map<string, Embed>;
submitInProgress?: boolean;
disableSubmit?: boolean;
disallowEmptyBody?: boolean;
isValid?: () => boolean;
preview?: boolean;
Expand All @@ -50,6 +51,7 @@
body = $bindable(""),
embeds = new Map(),
submitInProgress = false,
disableSubmit = false,
disallowEmptyBody = false,
isValid = () => true,
stylePadding,
Expand Down Expand Up @@ -276,7 +278,7 @@
</div>
{/if}
<div class="buttons">
<OutlineButton variant="ghost" onclick={selectFiles}>
<OutlineButton variant="ghost" onclick={selectFiles} disabled={preview}>
<Icon name="attachment" />
<span class="global-hide-on-small-desktop-down">Attach</span>
</OutlineButton>
Expand All @@ -293,6 +295,7 @@
variant="ghost"
disabled={!isValid() ||
submitInProgress ||
disableSubmit ||
(disallowEmptyBody && body.trim() === "")}
onclick={submitFn}>
<Icon name="checkmark" />
Expand Down
2 changes: 2 additions & 0 deletions src/views/repo/CreateIssue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
</div>

<ExtendedTextarea
disableSubmit={title.trim() === ""}
disallowEmptyBody
submitCaption="Save"
close={() => window.history.back()}
submit={async ({ comment, embeds }) => {
Expand Down

0 comments on commit 5f26f71

Please sign in to comment.