Skip to content

Build your personal knowledge base with Trilium Notes

chore(react/type_widget): fix 4px scroll in SVG editor

Elian Doran8e9f5fb48677
diff --git a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.css b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.css
index bfa9f9824f..008652b51e 100644
--- a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.css
+++ b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.css
@@ -21,6 +21,10 @@
contain: size !important;
}
+.note-detail-split .note-detail-code-editor .cm-editor {
+ margin: 0 !important;
+}
+
.note-detail-split .note-detail-error-container {
font-family: var(--monospace-font-family);
margin: 5px;
diff --git a/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx b/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
index 13661b1c45..739422b3bf 100644
--- a/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
+++ b/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
@@ -23,6 +23,7 @@ export default function SvgSplitEditor({ note, attachmentName, renderSvg, ...pro
const [ svg, setSvg ] = useState<string>();
const [ error, setError ] = useState<string | null | undefined>();
+ // Render the SVG.
async function onContentChanged(content: string) {
try {
const svg = await renderSvg(content);
@@ -36,6 +37,7 @@ export default function SvgSplitEditor({ note, attachmentName, renderSvg, ...pro
}
}
+ // Save as attachment.
function onSave() {
const payload = {
role: "image",