From 6a313b99e41590b01cc7b8f71b3b87e70a8a69c5 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 2 Feb 2026 18:02:47 +0200 Subject: [PATCH] fix(mobile/custom_note_actions): missing file upload --- .../src/widgets/react/FormFileUpload.tsx | 25 ++++++++++++++++++- apps/client/src/widgets/react/FormList.tsx | 2 +- .../src/widgets/ribbon/NoteActionsCustom.tsx | 17 +++++++------ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/apps/client/src/widgets/react/FormFileUpload.tsx b/apps/client/src/widgets/react/FormFileUpload.tsx index e97e73184b..42d9c908eb 100644 --- a/apps/client/src/widgets/react/FormFileUpload.tsx +++ b/apps/client/src/widgets/react/FormFileUpload.tsx @@ -3,8 +3,9 @@ import { useEffect, useRef } from "preact/hooks"; import ActionButton, { ActionButtonProps } from "./ActionButton"; import Button, { ButtonProps } from "./Button"; +import { FormListItem, FormListItemOpts } from "./FormList"; -interface FormFileUploadProps { +export interface FormFileUploadProps { name?: string; onChange: (files: FileList | null) => void; multiple?: boolean; @@ -75,3 +76,25 @@ export function FormFileUploadActionButton({ onChange, ...buttonProps }: Omit ); } + +/** + * Similar to {@link FormFileUploadButton}, but uses an {@link FormListItem} instead of a normal {@link Button}. + * @param param the change listener for the file upload and the properties for the button. + */ +export function FormFileUploadFormListItem({ onChange, children, ...buttonProps }: Omit & Pick) { + const inputRef = useRef(null); + + return ( + <> + inputRef.current?.click()} + >{children} +