From 3366fb46cd74fb2282caba05831332f16b3aa4d5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 21 Aug 2023 22:20:42 -0400 Subject: [PATCH] fix: Copy Mermaid toolbar incorrectly positioned in read-only closes #5714 --- shared/editor/components/Styles.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index be0648d17..79de11745 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1074,13 +1074,19 @@ mark { overflow: hidden; } + /* Hide code without display none so toolbar can still be positioned against it */ &:not(.code-active) { - display: none; + height: 0; + margin: -0.5em 0; + overflow: hidden; } } +/* Hide code without display none so toolbar can still be positioned against it */ .ProseMirror[contenteditable="false"] .code-block[data-language=mermaidjs] { - display: none; + height: 0; + margin: -0.5em 0; + overflow: hidden; } .code-block.with-line-numbers {