Skip to content

Commit bf7795d

Browse files
committed
nav.js: fix CM height to show full code without scroll
1 parent f54ab6c commit bf7795d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

assets/nav.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@
142142
lineWrapping: false,
143143
});
144144
cm.setSize('100%', 'auto');
145+
// Force CM to expand to full content height
146+
const cmEl = wrap.querySelector('.CodeMirror');
147+
const scroller = wrap.querySelector('.CodeMirror-scroll');
148+
if (cmEl) cmEl.style.height = 'auto';
149+
if (scroller) { scroller.style.height = 'auto'; scroller.style.overflowY = 'visible'; }
150+
cm.refresh();
145151
});
146152
});
147153
});

0 commit comments

Comments
 (0)