From 7e16c39f9a8c0a187fdafb4447e131134c5651a8 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Wed, 4 Feb 2026 09:40:40 -0800 Subject: [PATCH] fix safari upload bug --- .../editor/components/slash-menu/menu-items.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/client/src/features/editor/components/slash-menu/menu-items.ts b/apps/client/src/features/editor/components/slash-menu/menu-items.ts index bebefed4..27793f62 100644 --- a/apps/client/src/features/editor/components/slash-menu/menu-items.ts +++ b/apps/client/src/features/editor/components/slash-menu/menu-items.ts @@ -170,6 +170,8 @@ const CommandGroups: SlashMenuGroupedItemsType = { input.type = "file"; input.accept = "image/*"; input.multiple = true; + input.style.display = "none"; + document.body.appendChild(input); input.onchange = async () => { if (input.files?.length) { for (const file of input.files) { @@ -179,8 +181,7 @@ const CommandGroups: SlashMenuGroupedItemsType = { } } - // Reset the input value to allow uploading the same file again if needed - input.value = ""; + input.remove(); }; input.click(); }, @@ -202,6 +203,8 @@ const CommandGroups: SlashMenuGroupedItemsType = { input.type = "file"; input.accept = "video/*"; input.multiple = true; + input.style.display = "none"; + document.body.appendChild(input); input.onchange = async () => { if (input.files?.length) { for (const file of input.files) { @@ -211,8 +214,7 @@ const CommandGroups: SlashMenuGroupedItemsType = { } } - // Reset the input value to allow uploading the same file again if needed - input.value = ""; + input.remove(); }; input.click(); }, @@ -234,6 +236,8 @@ const CommandGroups: SlashMenuGroupedItemsType = { input.type = "file"; input.accept = ""; input.multiple = true; + input.style.display = "none"; + document.body.appendChild(input); input.onchange = async () => { if (input.files?.length) { for (const file of input.files) { @@ -243,8 +247,7 @@ const CommandGroups: SlashMenuGroupedItemsType = { } } - // Reset the input value to allow uploading the same file again if needed - input.value = ""; + input.remove(); }; input.click(); },