Skip to content

Commit c61a604

Browse files
committed
Allow DOM events to be ignored by setting codemirrorIgnore
Issue #1681
1 parent d881293 commit c61a604

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/manual.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ <h2 id="events">Events</h2>
496496
<strong>"dragover"</strong>, <strong>"drop"</strong>
497497
(instance: CodeMirror, event: Event)</code></dt>
498498
<dd>Fired when CodeMirror is handling a DOM event of this type.
499-
You can <code>preventDefault</code> the event to signal that
499+
You can <code>preventDefault</code> the event, or give it a
500+
truthy <code>codemirrorIgnore</code> property, to signal that
500501
CodeMirror should do no further handling.</dd>
501502
</dl>
502503

lib/codemirror.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5251,7 +5251,7 @@ window.CodeMirror = (function() {
52515251

52525252
function signalDOMEvent(cm, e, override) {
52535253
signal(cm, override || e.type, cm, e);
5254-
return e_defaultPrevented(e);
5254+
return e_defaultPrevented(e) || e.codemirrorIgnore;
52555255
}
52565256

52575257
function fireDelayed() {

0 commit comments

Comments
 (0)