Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Quick fixes

Tim Wilson9a3df656d11d
diff --git a/apps/web/ui/folders/add-folder-form.tsx b/apps/web/ui/folders/add-folder-form.tsx
index e106c3ad37..7331cead71 100644
--- a/apps/web/ui/folders/add-folder-form.tsx
+++ b/apps/web/ui/folders/add-folder-form.tsx
@@ -134,6 +134,7 @@ export const AddFolderForm = ({ onSuccess, onCancel }: AddFolderFormProps) => {
className="mt-2 block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
aria-invalid="true"
value={description}
+ maxLength={FOLDER_MAX_DESCRIPTION_LENGTH}
onChange={(e) => setDescription(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
diff --git a/apps/web/ui/folders/edit-folder-form.tsx b/apps/web/ui/folders/edit-folder-form.tsx
index 76c1d80959..4ce73c08f8 100644
--- a/apps/web/ui/folders/edit-folder-form.tsx
+++ b/apps/web/ui/folders/edit-folder-form.tsx
@@ -5,7 +5,7 @@ import {
FOLDER_MAX_DESCRIPTION_LENGTH,
updateFolderSchema,
} from "@/lib/zod/schemas/folders";
-import { Button } from "@dub/ui";
+import { Button, useEnterSubmit } from "@dub/ui";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
@@ -33,6 +33,8 @@ export function EditFolderForm({
},
);
+ const { handleKeyDown } = useEnterSubmit();
+
return (
<form
onSubmit={handleSubmit(async (data) => {
@@ -75,7 +77,10 @@ export function EditFolderForm({
</span>
<textarea
className="mt-2 block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
- {...register("description")}
+ onKeyDown={handleKeyDown}
+ {...register("description", {
+ maxLength: FOLDER_MAX_DESCRIPTION_LENGTH,
+ })}
/>
<MaxCharactersCounter
control={control}
diff --git a/packages/ui/src/sheet.tsx b/packages/ui/src/sheet.tsx
index bacc919614..4126acdb04 100644
--- a/packages/ui/src/sheet.tsx
+++ b/packages/ui/src/sheet.tsx
@@ -17,7 +17,7 @@ function SheetRoot({
<RootComponent direction="right" handleOnly {...rest}>
<Drawer.Portal>
<Drawer.Overlay
- className="fixed inset-0 bg-black/20"
+ className="fixed inset-0 z-40 bg-black/20"
data-sheet-overlay
/>
<Drawer.Content
@@ -33,7 +33,7 @@ function SheetRoot({
contentProps?.onPointerDownOutside?.(e);
}}
className={cn(
- "@container/sheet fixed bottom-2 right-2 top-2 z-10 flex w-[calc(100%-16px)] outline-none md:w-[540px]",
+ "@container/sheet fixed bottom-2 right-2 top-2 z-40 flex w-[calc(100%-16px)] outline-none md:w-[540px]",
contentProps?.className,
)}
style={