Skip to content

Commit 7399302

Browse files
committed
feat: disable create card button when title is empty or form is submitting
1 parent c3daa0b commit 7399302

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/web/src/views/board/components/NewCardForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function NewCardForm({
6363
const memberPublicIds = watch("memberPublicIds") || [];
6464
const isCreateAnotherEnabled = watch("isCreateAnotherEnabled");
6565
const position = watch("position");
66+
const title = watch("title");
6667

6768
const { data: boardData } = api.board.byId.useQuery(queryParams, {
6869
enabled: !!boardPublicId,
@@ -388,7 +389,7 @@ export function NewCardForm({
388389
/>
389390

390391
<div>
391-
<Button type="submit">Create card</Button>
392+
<Button type="submit" disabled={title.length === 0 || createCard.isPending}>Create card</Button>
392393
</div>
393394
</div>
394395
</form>

0 commit comments

Comments
 (0)