diff --git a/apps/web/src/components/FeedbackButton.tsx b/apps/web/src/components/FeedbackButton.tsx
index 4495cd57..887f7de1 100644
--- a/apps/web/src/components/FeedbackButton.tsx
+++ b/apps/web/src/components/FeedbackButton.tsx
@@ -98,12 +98,16 @@ const FeedbackButton: React.FC = () => {
onChange={(e) => {
setValue("feedback", e.target.value);
}}
- onKeyDown={(e) => {
- e.stopPropagation();
- }}
value={watch("feedback")}
contentEditable
className="max-h-[300px] min-h-[100px]"
+ onKeyDown={async (e) => {
+ e.stopPropagation();
+ if (e.key === "Enter" && e.shiftKey) {
+ e.preventDefault();
+ await handleSubmit(onSubmit)();
+ }
+ }}
/>
diff --git a/apps/web/src/components/Input.tsx b/apps/web/src/components/Input.tsx
index d2712b2e..8a24d212 100644
--- a/apps/web/src/components/Input.tsx
+++ b/apps/web/src/components/Input.tsx
@@ -69,6 +69,7 @@ const Input = forwardRef
(
prefix && "rounded-l-none",
className && className,
)}
+ onKeyDown={onKeyDown}
{...props}
/>
{type === "password" && (
diff --git a/apps/web/src/components/LabelForm.tsx b/apps/web/src/components/LabelForm.tsx
index c591c50e..5b2d8b41 100644
--- a/apps/web/src/components/LabelForm.tsx
+++ b/apps/web/src/components/LabelForm.tsx
@@ -1,5 +1,5 @@
import { Listbox, Transition } from "@headlessui/react";
-import { Fragment } from "react";
+import { Fragment, useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { HiChevronUpDown, HiXMark } from "react-icons/hi2";
@@ -103,6 +103,12 @@ export function LabelForm({
}
};
+ useEffect(() => {
+ const nameElement: HTMLElement | null =
+ document.querySelector("#label-name");
+ if (nameElement) nameElement.focus();
+ }, []);
+
return (
diff --git a/apps/web/src/views/board/components/NewCardForm.tsx b/apps/web/src/views/board/components/NewCardForm.tsx
index cc891a86..6d028e3a 100644
--- a/apps/web/src/views/board/components/NewCardForm.tsx
+++ b/apps/web/src/views/board/components/NewCardForm.tsx
@@ -238,7 +238,17 @@ export function NewCardForm({
-
+ {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ await handleSubmit(onSubmit)();
+ }
+ }}
+ />
setValue("description", e.target.value)}
value={watch("description")}
contentEditable
+ onKeyDown={async (e) => {
+ if (e.key === "Enter" && e.shiftKey) {
+ e.preventDefault();
+ await handleSubmit(onSubmit)();
+ }
+ }}
/>
diff --git a/apps/web/src/views/board/components/NewListForm.tsx b/apps/web/src/views/board/components/NewListForm.tsx
index 9cfa014a..b6c64693 100644
--- a/apps/web/src/views/board/components/NewListForm.tsx
+++ b/apps/web/src/views/board/components/NewListForm.tsx
@@ -122,7 +122,17 @@ export function NewListForm({
-
+
{
+ if (e.key === "Enter") {
+ e.preventDefault();
+ await handleSubmit(onSubmit)();
+ }
+ }}
+ />
diff --git a/apps/web/src/views/boards/components/NewBoardForm.tsx b/apps/web/src/views/boards/components/NewBoardForm.tsx
index 7ff2e28d..0303f890 100644
--- a/apps/web/src/views/boards/components/NewBoardForm.tsx
+++ b/apps/web/src/views/boards/components/NewBoardForm.tsx
@@ -1,9 +1,11 @@
+import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { HiXMark } from "react-icons/hi2";
import type { NewBoardInput } from "@kan/api/types";
import Button from "~/components/Button";
+import Input from "~/components/Input";
import { useModal } from "~/providers/modal";
import { useWorkspace } from "~/providers/workspace";
import { api } from "~/utils/api";
@@ -33,6 +35,12 @@ export function NewBoardForm() {
createBoard.mutate(data);
};
+ useEffect(() => {
+ const titleElement: HTMLElement | null =
+ document.querySelector
("#name");
+ if (titleElement) titleElement.focus();
+ }, []);
+
return (
diff --git a/apps/web/src/views/card/components/NewCommentForm.tsx b/apps/web/src/views/card/components/NewCommentForm.tsx
index b105a11b..128a1ae8 100644
--- a/apps/web/src/views/card/components/NewCommentForm.tsx
+++ b/apps/web/src/views/card/components/NewCommentForm.tsx
@@ -58,6 +58,12 @@ const NewCommentForm = ({ cardPublicId }: { cardPublicId: string }) => {
disabled={false}
onChange={(e) => setValue("comment", e.target.value)}
className="block w-full border-0 bg-transparent py-1.5 text-light-900 focus-visible:outline-none dark:text-dark-1000 sm:text-sm sm:leading-6"
+ onKeyDown={async (e) => {
+ if (e.key === "Enter" && e.shiftKey) {
+ e.preventDefault();
+ await handleSubmit(onSubmit)();
+ }
+ }}
/>