+5
-4
src/components/create.tsx
+5
-4
src/components/create.tsx
···
128
128
}
129
129
};
130
130
131
-
const dragDiv = (box: HTMLDivElement) => {
131
+
const dragBox = (box: HTMLDivElement) => {
132
132
let currentBox: HTMLDivElement | null = null;
133
133
let isDragging = false;
134
134
let offsetX: number;
···
142
142
143
143
if (
144
144
["INPUT", "SELECT", "BUTTON", "LABEL"].includes(e.target.tagName) ||
145
-
e.target.closest("#editor")
145
+
e.target.closest("#editor, #close")
146
146
)
147
147
return;
148
148
···
252
252
<div
253
253
data-draggable
254
254
class="dark:bg-dark-300 dark:shadow-dark-700 absolute top-70 left-[50%] w-[20rem] -translate-x-1/2 rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 p-4 shadow-md transition-opacity duration-200 dark:border-neutral-700 starting:opacity-0"
255
-
ref={dragDiv}
255
+
ref={dragBox}
256
256
>
257
257
<h2 class="mb-2 font-semibold">Upload blob</h2>
258
258
<div class="flex flex-col gap-2 text-sm">
···
310
310
<div
311
311
data-draggable
312
312
class="dark:bg-dark-300 dark:shadow-dark-700 absolute top-16 left-[50%] w-screen -translate-x-1/2 cursor-grab rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 p-4 shadow-md transition-opacity duration-200 sm:w-xl lg:w-[48rem] dark:border-neutral-700 starting:opacity-0"
313
-
ref={dragDiv}
313
+
ref={dragBox}
314
314
>
315
315
<div class="mb-2 flex w-full justify-between">
316
316
<div class="font-semibold">
317
317
<span class="select-none">{props.create ? "Creating" : "Editing"} record</span>
318
318
</div>
319
319
<button
320
+
id="close"
320
321
onclick={() => setOpenDialog(false)}
321
322
class="flex items-center rounded-lg p-1 hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700 dark:active:bg-neutral-600"
322
323
>