fix: respect mobile header and widget interactions

This commit is contained in:
ajnart committed 2026-08-28 07:03:33 +02:00
1 parent 5f572f1b92
commit ad0d6e0498
10 files changed
+87 -81

No files matched your search

+19 -4
View File
@@ -7,6 +7,7 @@ import { useI18n } from "@homarr/translation/client";
interface ModalFormFooterProps {
onCancel: () => void;
form?: string;
submitLabel?: string;
cancelLabel?: string;
loading?: boolean;
@@ -18,7 +19,8 @@ const ActionButtons = ({
submitLabel,
cancelLabel,
loading,
}: Pick<ModalFormFooterProps, "onCancel" | "submitLabel" | "cancelLabel" | "loading">) => {
form,
}: Pick<ModalFormFooterProps, "onCancel" | "submitLabel" | "cancelLabel" | "loading" | "form">) => {
const t = useI18n();
return (
@@ -26,16 +28,29 @@ const ActionButtons = ({
<Button onClick={onCancel} variant="subtle" color="gray">
{cancelLabel ?? t("common.action.cancel")}
</Button>
<Button type="submit" loading={loading}>
<Button type="submit" form={form} loading={loading}>
{submitLabel ?? t("common.action.saveChanges")}
</Button>
</>
);
};
export const ModalFormFooter = ({ onCancel, submitLabel, cancelLabel, loading, leftSection }: ModalFormFooterProps) => {
export const ModalFormFooter = ({
onCancel,
form,
submitLabel,
cancelLabel,
loading,
leftSection,
}: ModalFormFooterProps) => {
const actionButtons = (
<ActionButtons onCancel={onCancel} submitLabel={submitLabel} cancelLabel={cancelLabel} loading={loading} />
<ActionButtons
onCancel={onCancel}
form={form}
submitLabel={submitLabel}
cancelLabel={cancelLabel}
loading={loading}
/>
);
if (leftSection) {