Skip to content

Commit 0fb17df

Browse files
committed
[panel plugin] Make stable option also take effect when a panel is removed
Issue codemirror#4485
1 parent f78c091 commit 0fb17df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

addon/display/panel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
this.cleared = true;
5858
var info = this.cm.state.panels;
5959
this.cm._setSize(null, info.heightLeft += this.height);
60+
if (this.options.stable && isAtTop(this.cm, this.node))
61+
this.cm.scrollTo(null, this.cm.getScrollInfo().top - this.height)
6062
info.wrapper.removeChild(this.node);
6163
if (--info.panels == 0) removePanels(this.cm);
6264
};

0 commit comments

Comments
 (0)