1
0
Эх сурвалжийг харах

fix: Fix the problem of long text folding when JsonViewer does not enable automatic line wrapping. (#2756)

* fix: resolve line number display issue in JsonViewer under Tooltip
* fix: resolve long text folding issue

---------

Co-authored-by: 田丰 <[email protected]>
田丰 6 сар өмнө
parent
commit
9f91ed5912

+ 2 - 0
packages/semi-foundation/jsonViewer/jsonViewer.scss

@@ -83,6 +83,8 @@ $module: #{$prefix}-json-viewer;
         text-align: center;
         width: 50px;
         user-select: none;
+        word-wrap: normal !important;
+        overflow-wrap: normal !important;
     }
 
     &-content-container {

+ 3 - 0
packages/semi-json-viewer-core/src/view/view.ts

@@ -418,6 +418,9 @@ export class View {
                 const span = document.createElement('span');
                 span.className = token.scopes;
                 span.textContent = content;
+                if (!this._options?.autoWrap) {
+                    span.style.whiteSpace = 'pre';
+                }
                 container.appendChild(span);
             }