Skip to content

Commit 6712860

Browse files
committed
Fix the issue where the top scroll bar is not visible when the chart is enlarged.
Signed-off-by: yuluo-yx <[email protected]>
1 parent 56edc9e commit 6712860

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

website/src/components/ZoomableMermaid/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ const ZoomableMermaid = ({ children, title, defaultZoom = 1.2 }) => {
187187
>
188188
<div
189189
className={styles.diagramContainer}
190-
style={{ transform: `scale(${zoomLevel})`, transformOrigin: 'center' }}
190+
style={{
191+
transform: `scale(${zoomLevel})`,
192+
// Ensure scaling is from the center of the diagram.
193+
// Fix the issue where the top scroll bar is not visible when the chart is enlarged.
194+
transformOrigin: 'center top'
195+
}}
191196
>
192197
<Mermaid value={children} />
193198
</div>

website/src/components/ZoomableMermaid/styles.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@
203203
overflow: auto;
204204
flex: 1;
205205
display: flex;
206-
align-items: center;
206+
/* must be flex-start. */
207+
align-items: flex-start;
207208
justify-content: center;
208209
min-height: 0;
209210
background: var(--tech-surface-bg);

0 commit comments

Comments
 (0)