diff --git a/package.json b/package.json index e97bff9..01b60c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app-ts", - "version": "1.6.1", + "version": "1.6.2", "description": "", "main": "dist/server.js", "scripts": { diff --git a/src/admin/components/RichEditor.tsx b/src/admin/components/RichEditor.tsx index 0526ded..9e5de25 100644 --- a/src/admin/components/RichEditor.tsx +++ b/src/admin/components/RichEditor.tsx @@ -1,4 +1,4 @@ -import { useMemo, useRef, useCallback, useEffect } from "react"; +import { useMemo, useRef, useCallback, useLayoutEffect } from "react"; import ReactQuill from "react-quill-new"; import "react-quill-new/dist/quill.snow.css"; @@ -96,11 +96,14 @@ export default function RichEditor({ [onChange], ); - useEffect(() => { + useLayoutEffect(() => { if (!quillRef.current) return; const editor = quillRef.current.getEditor(); editor.format("font", "tahoma"); editor.format("size", "14px"); + // Quill auto-focuses on mount with existing content, which scrolls + // the page to the editor. Blur to prevent unwanted scroll. + editor.blur(); }, []); return ( diff --git a/src/routes/admin/offers-pdf.ts b/src/routes/admin/offers-pdf.ts index c0988bc..b81aeb8 100644 --- a/src/routes/admin/offers-pdf.ts +++ b/src/routes/admin/offers-pdf.ts @@ -632,14 +632,6 @@ ${indentCSS} border: none; vertical-align: top; } - .logo-header { - text-align: right; - padding-bottom: 4mm; - } - .first-content { - margin-top: -26mm; - } - /* ---- Page break helpers ---- */ table.page-layout thead { display: table-header-group; } table.items tbody tr { break-inside: avoid; } @@ -696,30 +688,16 @@ ${indentCSS} display: block; width: 100%; } - .first-content { - margin-top: 0 !important; - } - .logo-header { - text-align: right; - padding-bottom: 0; - margin-bottom: -18mm; - } }
- +|
- ${logoImg}
- |
|
- ${escapeHtml(t("title"))}
@@ -727,9 +705,13 @@ ${indentCSS}
${quotation.project_code ? `${escapeHtml(quotation.project_code)} ` : ""}
${escapeHtml(t("valid_until"))}: ${escapeHtml(formatDate(quotation.valid_until))}
${logoImg} ` : ""}
- + |
|
${escapeHtml(t("customer"))}
@@ -763,7 +745,6 @@ ${indentCSS}
${totalsHtml}
|