Skip to content

Commit 9db6f90

Browse files
committed
fix: JSON viewer no longer makes the layout jump in a shrink-to-fit parent, its width does not depend on its lines anymore so re-wrapping them cannot resize the parent in a loop AdminForth/2005
1 parent acc59f9 commit 9db6f90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎adminforth/spa/src/afcl/JsonViewer.vue‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
</div>
2222
</teleport>
2323
</div>
24-
<div v-else ref="viewerEl" class="afcl-json-viewer group relative flex items-start gap-2 font-mono text-xs leading-5">
24+
<!-- the line width comes from the measured width of the viewer; inline-size containment keeps that width from depending on the
25+
lines, otherwise in a shrink-to-fit parent (a flex-wrap item, a cell of an auto table) every re-wrap resizes the parent and loops -->
26+
<div v-else ref="viewerEl" class="afcl-json-viewer group relative flex items-start gap-2 font-mono text-xs leading-5 [contain:inline-size]">
2527
<span ref="charEl" class="invisible absolute" aria-hidden="true">0</span>
2628
<div class="min-w-0">
2729
<JsonViewerNode :value="value" :depth="0" :last="true" :expandDepth="expandDepth" :lineWidth="lineWidth" />

0 commit comments

Comments
 (0)