Skip to content

Commit 90aead7

Browse files
jochenbergermarijnh
authored andcommitted
when checking whether the wrapper element is still part of the DOM, check all the way up to the document body
1 parent 32abd31 commit 90aead7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/codemirror.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,10 +1316,11 @@ window.CodeMirror = (function() {
13161316
// Prevent wrapper from ever scrolling
13171317
on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
13181318
on(window, "resize", function resizeHandler() {
1319+
var currentParent = d.wrapper.parentNode;
13191320
// Might be a text scaling operation, clear size caches.
13201321
d.cachedCharWidth = d.cachedTextHeight = null;
13211322
clearCaches(cm);
1322-
if (d.wrapper.parentNode) updateDisplay(cm, true);
1323+
if (currentParent === document.body) updateDisplay(cm, true);
13231324
else off(window, "resize", resizeHandler);
13241325
});
13251326

0 commit comments

Comments
 (0)