Skip to content

Commit 0612ed0

Browse files
committed
[panel demo] Prevent editor from losing focus when closing a panel
See https://discuss.codemirror.net/t/codemirror-panel-demo-cursor-disappears-on-closing-panel/1946
1 parent f658d09 commit 0612ed0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

demo/panel.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ <h2>Panel Demo</h2>
106106
close.setAttribute("title", "Remove me!");
107107
close.setAttribute("class", "remove-panel");
108108
close.textContent = "✖";
109-
CodeMirror.on(close, "click", function() {
109+
CodeMirror.on(close, "mousedown", function(e) {
110+
e.preventDefault()
110111
panels[node.id].clear();
111112
});
112113
label = node.appendChild(document.createElement("span"));

0 commit comments

Comments
 (0)