NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3144 most downloaded on npm
DOM view component for the CodeMirror code editor
Last release 12 days ago
22 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
258 releases · first in 2020
One column per quarter.
Fix a crash that occasionally occurred when drag-selecting in a way that scrolled the editor.
Fix a crash that occasionally occurred when drag-selecting in a way that scrolled the editor.
The new EditorView.compositionStarted property indicates whether a composition is starting.
Fix several issues where editing or composition went wrong due to our zero-width space kludge characters ending up in unexpected places.
Fix several issues where editing or composition went wrong due to our zero-width space kludge characters ending up in unexpected places.
Make sure the editor re-measures its dimensions whenever its theme changes.
Fix an issue where some keys on Android phones could leave the editor DOM unsynced with the actual document.
Fix a regression in cursor position determination after making an edit next to a widget.
Fix a regression in cursor position determination after making an edit next to a widget.
Fix an issue where the editor's view of its content height could go out of sync with the DOM when a line-wrapping editor had its width changed, causin
Fix an issue where the editor's view of its content height could go out of sync with the DOM when a line-wrapping editor had its width changed, causing wrapping to change.
Fix a bug that caused the editor to draw way too much content when scrolling to a position in an editor (much) taller than the window.
Report an error when a replace decoration from a plugin crosses a line break, rather than silently ignoring it.
Fix an issue where reading DOM changes was broken when lineSeparator contained more than one character.
Make ordering of replace and mark decorations with the same extent and inclusivness more predictable by giving replace decorations precedence.
Fix a bug where, on Chrome, replacement across line boundaries and next to widgets could cause bogus zero-width characters to appear in the content.
Make composition input properly appear at secondary cursors (except when those are in the DOM node with the composition, in which case the browser won
Make composition input properly appear at secondary cursors (except when those are in the DOM node with the composition, in which case the browser won't allow us to intervene without aborting the composition).
Fix a bug that cause the editor to get confused about which content was visible after scrolling something into view.
Fix a bug where the dummy elements rendered around widgets could end up in a separate set of wrapping marks, and thus become visible.
EditorView.moveVertically now preserves the assoc property of the input range.
Get rid of gaps between selection elements drawn by drawSelection.
Fix an issue where replacing text next to a widget might leak bogus zero-width spaces into the document.
Avoid browser selection mishandling when a focused view has setState called by eagerly refocusing it.
Make sure the editor signals a geometryChanged update when its width changes.
Make sure the editor signals a geometryChanged update when its width changes.
EditorView.darkTheme can now be queried to figure out whether the editor is using a dark theme.
Fix a bug that caused line decorations with a class property to suppress all other line decorations for that line.
Fix a bug that caused line decorations with a class property to suppress all other line decorations for that line.
Fix a bug that caused scroll effects to be corrupted when further updates came in before they were applied.
Fix an issue where, depending on which way a floating point rounding error fell, posAtCoords (and thus vertical cursor motion) for positions outside of the vertical range of the document might or might not return the start/end of the document.
Fix regression where plugin replacing decorations that span to the end of the line are ignored.
Fix regression where plugin replacing decorations that span to the end of the line are ignored.
Fix a crash in posAtCoords when the position lies in a block widget that is rendered but scrolled out of view.
Fix a crash in posAtCoords when the position lies in a block widget that is rendered but scrolled out of view.
Adding block decorations from a plugin now raises an error. Replacing decorations that cross lines are ignored, when provided by a plugin.
Fix inverted interpretation of the precise argument to posAtCoords.
The editor will now handle double-taps as if they are double-clicks, rather than letting the browser's native behavior happen (because the latter ofte
The editor will now handle double-taps as if they are double-clicks, rather than letting the browser's native behavior happen (because the latter often does the wrong thing).
Fix an issue where backspacing out a selection on Chrome Android would sometimes only delete the last character due to event order issues.
posAtCoords, without second argument, will no longer return null for positions below or above the document.
Fix a bug where content line elements would in some cases lose their cm-line class.
Fix a bug where content line elements would in some cases lose their cm-line class.
EditorView.scrollTo and EditorView.centerOn are deprecated in favor of EditorView.scrollIntoView, and will be removed in the next breaking release.
EditorView.scrollTo and EditorView.centerOn are deprecated in favor of EditorView.scrollIntoView, and will be removed in the next breaking release.
Fix an issue that could cause the editor to unnecessarily interfere with composition (especially visible on macOS Chrome).
A composition started with multiple lines selected will no longer be interruptd by the editor.
The new EditorView.scrollIntoView function allows you to do more fine-grained scrolling.
Fix a bug where CodeMirror's own event handers would run even after a user-supplied handler called preventDefault on an event.
Fix a bug where CodeMirror's own event handers would run even after a user-supplied handler called preventDefault on an event.
Properly draw selections when negative text-indent is used for soft wrapping.
Fix an issue where viewportLineBlocks could hold inaccurate height information when the vertical scaling changed.
Fixes drop cursor positioning when the document is scrolled. Force a content measure when the editor comes into view
Fix a bug that could cause the editor to not measure its layout the first time it came into view.
The package now exports a dropCursor extension that draws a cursor at the current drop position when dragging content over the editor.
The package now exports a dropCursor extension that draws a cursor at the current drop position when dragging content over the editor.
Refine Android key event handling to work properly in a GBoard corner case where pressing Enter fires a bunch of spurious deleteContentBackward events
Refine Android key event handling to work properly in a GBoard corner case where pressing Enter fires a bunch of spurious deleteContentBackward events.
Fix a crash in drawSelection for some kinds of selections.
Prevent a possibility where some content updates causes duplicate text to remain in DOM.
Support a maxLength option to MatchDecorator that allows user code to control how far it scans into hidden parts of viewport lines.
Fix a bug that could cause out-of-view editors to get a nonsensical viewport and fail to scroll into view when asked to.
Fix a bug that could cause out-of-view editors to get a nonsensical viewport and fail to scroll into view when asked to.
Fix a bug where would return 0 when clicking below the content if the last line was replaced with a block widget decoration.
Fix an issue where clicking at the position of the previous cursor in a blurred editor would cause the selection to reset to the start of the document.
Fix an issue where composition could be interrupted if the browser created a new node inside a mark decoration node.
Fix an issue where pressing Enter on Chrome Android during composition did not fire key handlers for Enter.
Fix an issue where pressing Enter on Chrome Android during composition did not fire key handlers for Enter.
Avoid a Chrome bug where the virtual keyboard closes when pressing backspace after a widget.
Fix an issue where the editor could show a horizontal scroll bar even after all lines that caused it had been deleted or changed.
Fix a bug that could cause EditorView.plugin to inappropriately return null during plugin initialization.
Fix a bug that could cause EditorView.plugin to inappropriately return null during plugin initialization.
Fix a bug where a block widget without estimatedHeight at the end of the document could fail to be drawn
Widgets can now define a destroy method that is called when they are removed from the view.
Widgets can now define a destroy method that is called when they are removed from the view.
Widgets around replaced ranges are now visible when their side does not point towards the replaced range.
Widgets around replaced ranges are now visible when their side does not point towards the replaced range.
A replaced line with a line decoration no longer creates an extra empty line block in the editor.
The scrollPastEnd extension will now over-reserve space at the bottom of the editor on startup, to prevent restored scroll positions from being clipped.
EditorView.editorAttributes and contentAttributes may now hold functions that produce the attributes.
Fix a bug where lineBlockAt, for queries inside the viewport, would always return the first line in the viewport.
Fix a bug where lineBlockAt, for queries inside the viewport, would always return the first line in the viewport.
Fix an issue where after some kinds of changes, EditorView.viewportLineBlocks held an out-of-date set of blocks.
Fix an issue where after some kinds of changes, EditorView.viewportLineBlocks held an out-of-date set of blocks.
Export EditorView.documentPadding, with information about the vertical padding of the document.
…and more efficient replacement for the (now deprecated) blockAtHeight, visualLineAtHeight, and visualLineAt methods.
Fix an issue where editors with large vertical padding (for example via scrollPastEnd) could sometimes lose their scroll position on Chrome.
Avoid some unnecessary DOM measuring work by more carefully checking whether it is needed.
The new elementAtHeight, lineBlockAtHeight, and lineBlockAt methods provide a simpler and more efficient replacement for the (now deprecated) blockAtHeight, visualLineAtHeight, and visualLineAt methods.
The editor view now exports a documentTop getter that gives you the vertical position of the top of the document. All height info is queried and reported relative to this top.
The editor view's new viewportLineBlocks property provides an array of in-viewport line blocks, and replaces the (now deprecated) viewportLines method.
Fix a problem where the DOM update would unnecessarily trigger browser relayouts.
Fix a problem where the DOM update would unnecessarily trigger browser relayouts.
Run a measure cycle when the editor's size spontaneously changes.
Run a measure cycle when the editor's size spontaneously changes.
Fix a bug that caused the precedence of editorAttributes and contentAttributes to be inverted, making lower-precedence extensions override higher-prec
Fix a bug that caused the precedence of editorAttributes and contentAttributes to be inverted, making lower-precedence extensions override higher-precedence ones.
Fix an issue where the editor wasn't aware it was line-wrapping with its own lineWrapping extension enabled.
Fix an issue where the editor wasn't aware it was line-wrapping with its own lineWrapping extension enabled.
Avoid an issue where stretches of whitespace on line wrap points could cause the cursor to be placed outside of the content.
Avoid an issue where stretches of whitespace on line wrap points could cause the cursor to be placed outside of the content.
Block replacement decorations now default to inclusive, because non-inclusive block decorations are rarely what you need.
Block replacement decorations now default to inclusive, because non-inclusive block decorations are rarely what you need.
Fix an issue that caused block widgets to always have a large side value, making it impossible to show them between to replacement decorations.
Fix a crash that could happen after some types of viewport changes, due to a bug in the block widget view data structure.
Fix a bug where the editor would think it was invisible when the document body was given screen height and scroll behavior.
Fix a bug where the editor would think it was invisible when the document body was given screen height and scroll behavior.
Fix selection reading inside a shadow root on iOS.
Fix an issue where typing into a read-only editor would move the selection.
Fix an issue where typing into a read-only editor would move the selection.
Fix slowness when backspace is held down on iOS.
Fix a bug where backspace, enter, and delete would get applied twice on iOS.
Fix a bug where backspace, enter, and delete would get applied twice on iOS.
Make sure the workaround for the lost virtual keyboard on Chrome Android also works on slower phones. Slight style change in beforeinput handler
Make sure the workaround for the lost virtual keyboard on Chrome Android also works on slower phones. Slight style change in beforeinput handler
Avoid failure cases in viewport-based rendering of very long lines.
EditorView.scrollPosIntoView has been deprecated. Use the EditorView.scrollTo effect instead.
EditorView.scrollPosIntoView has been deprecated. Use the EditorView.scrollTo effect instead.
The new EditorView.centerOn effect can be used to scroll a given range to the center of the view.
Don't crash when IntersectionObserver fires its callback without any records. Try to handle some backspace issues on Chrome Android
Don't crash when IntersectionObserver fires its callback without any records. Try to handle some backspace issues on Chrome Android
Using backspace near uneditable widgets on Chrome Android should now be more reliable.
Work around a number of browser bugs by always rendering zero-width spaces around in-content widgets, so that browsers will treat the positions near them as valid cursor positions and not try to run composition across widget boundaries.
Work around bogus composition changes created by Chrome Android after handled backspace presses.
Work around an issue where tapping on an uneditable node in the editor would sometimes fail to show the virtual keyboard on Chrome Android.
Prevent translation services from translating the editor content. Show direction override characters as special chars by default
specialChars will now, by default, replace direction override chars, to mitigate https://trojansource.codes/ attacks.
The editor view will, if parent is given but root is not, derive the root from the parent element.
Line decorations now accept a class property to directly add DOM classes to the line.
Fix an issue where some kinds of reflows in the surrounding document could move unrendered parts of the editor into view without the editor noticing a
Fix an issue where some kinds of reflows in the surrounding document could move unrendered parts of the editor into view without the editor noticing and updating its viewport.
Fix an occasional crash in the selection drawing extension.
Fix a bug that could, on DOM changes near block widgets, insert superfluous line breaks.
Fix a bug that could, on DOM changes near block widgets, insert superfluous line breaks.
Make interacting with a destroyed editor view do nothing, rather than crash, to avoid tripping people up with pending timeouts and such.
Make sure ViewUpdate.viewportChanged is true whenever visibleRanges changes, so that plugins acting only on visible ranges can use it to check when to update.
Fix line-wise cut on empty lines.
The view is now aware of the new EditorState.readOnly property, and suppresses events that modify the document when it is true.
The view is now aware of the new EditorState.readOnly property, and suppresses events that modify the document when it is true.
Remove a console.log that slipped into the previous release.
Remove a console.log that slipped into the previous release.
The new EditorView.scrollTo effect can be used to scroll a given range into view.
The new EditorView.scrollTo effect can be used to scroll a given range into view.
Fix an issue where lines containing just a widget decoration wrapped in a mark decoration could be displayed with 0 height.
Fix an issue where lines containing just a widget decoration wrapped in a mark decoration could be displayed with 0 height.
Fix a view corruption that could happen in situations involving overlapping mark decorations.
Fix a view corruption that could happen in situations involving overlapping mark decorations.
The package now exports a scrollPastEnd function, which returns an extension that adds space below the document to allow the last line to be scrolled
The package now exports a scrollPastEnd function, which returns an extension that adds space below the document to allow the last line to be scrolled to the top of the editor.
The view now emits new-style user event annotations for the transactions it generates.
The view now emits new-style user event annotations for the transactions it generates.
Fix a bug where coordsAtPos would allow the passed side argument to override widget sides, producing incorrect cursor positions.
Fix a bug that could cause content lines to be misaligned in certain situations involving widgets at the end of lines.
Fix an issue where, if the browser decided to modify DOM attributes in the content in response to some editing action, the view failed to reset those again.
Fix a regression where EditorView.editable.of(false) didn't disable editing on Webkit-based browsers.
Fix a regression where EditorView.editable.of(false) didn't disable editing on Webkit-based browsers.
Fix a bug that caused EditorView.moveVertically to only move by one line, even when given a custom distance, in some cases.
Fix a bug that caused EditorView.moveVertically to only move by one line, even when given a custom distance, in some cases.
Hide Safari's native bold/italic/underline controls for the content.
Fix a CSS problem that prevented Safari from breaking words longer than the line in line-wrapping mode.
Avoid a problem where composition would be inappropriately abored on Safari.
Fix drag-selection that scrolls the content by dragging past the visible viewport.
posAtCoords now has an imprecise mode where it'll return an approximate position even for parts of the document that aren't currently rendered.
Make drawSelection behave properly when lines are split by block widgets.
Make drawSelection behave properly when lines are split by block widgets.
Make sure drawn selections that span a single line break don't leave a gap between the lines.
Fix a crash that could occur when the document changed during mouse selection.
Fix a crash that could occur when the document changed during mouse selection.
Fix a bug where composition inside styled content would sometimes be inappropriately aborted by editor DOM updates.
MouseSelectionStyle.update may now return true to indicate it should be queried for a new selection after the update.
Fix a bug that would, in very specific circumstances, cause posAtCoords to go into an infinite loop in Safari.
Fix a bug that would, in very specific circumstances, cause posAtCoords to go into an infinite loop in Safari.
Fix a bug where some types of IME input on Mobile Safari would drop text.
Fix an issue where the DOM selection was sometimes not properly updated when next to a widget.
Fix an issue where the DOM selection was sometimes not properly updated when next to a widget.
Invert the order in which overlapping decorations are drawn so that higher-precedence decorations are nested inside lower-precedence ones (and thus override their styling).
Fix a but in posAtCoords where it would in some situations return -1 instead of null.
A new plugin field, PluginField.atomicRanges, can be used to cause cursor motion to skip past some ranges of the document.
Fix a bug that would cause the content DOM update to crash in specific circumstances.
Fix a bug that would cause the content DOM update to crash in specific circumstances.
Work around an issue where, after some types of changes, Mobile Safari would ignore Enter presses.
Make iOS enter and backspace handling more robust, so that platform bugs are less likely to break those keys in the editor.
Fix a regression where Esc + Tab no longer allowed the user to exit the editor.
You can now drop text files into the editor.
Work around a Mobile Safari bug where, after backspacing out the last character on a line, Enter didn't work anymore.
Work around a Mobile Safari bug where, after backspacing out the last character on a line, Enter didn't work anymore.
Work around a problem in Mobile Safari where you couldn't tap to put the cursor at the end of a line that ended in a widget.
Add an attribute to prevent the Grammarly browser extension from messing with the editor content.
Add an attribute to prevent the Grammarly browser extension from messing with the editor content.
Fix more issues around selection handling a Shadow DOM in Safari.
Fix a bug where some types of updates wouldn't properly cause marks around the changes to be joined in the DOM.
Fix a bug where some types of updates wouldn't properly cause marks around the changes to be joined in the DOM.
Fix an issue where the content and gutters in a fixed-height editor could be smaller than the editor height.
Fix a crash on Safari when initializing an editor in an unfocused window.
Fix a bug where the editor would incorrectly conclude it was out of view in some types of absolutely positioned parent elements.
Fix a crash that occurred when determining DOM coordinates in some specific situations.
Fix a crash that occurred when determining DOM coordinates in some specific situations.
Fix a crash when a DOM change that ended at a zero-width view element (widget) removed that element from the DOM.
Disable autocorrect and autocapitalize by default, since in most code-editor contexts they get in the way. You can use EditorView.contentAttributes to override this.
Fix a bug that interfered with native touch selection handling on Android.
Fix an unnecessary DOM update after composition that would disrupt touch selection on Android.
Add a workaround for Safari's broken selection reporting when the editor is in a shadow DOM tree.
Fix select-all from the context menu on Safari.
Handle selection replacements where the inserted text matches the start/end of the replaced text better.
Handle selection replacements where the inserted text matches the start/end of the replaced text better.
Fix an issue where the editor would miss scroll events when it was placed in a DOM component slot.
Fix a crash when drag-selecting out of the editor with editable turned off.
Fix a crash when drag-selecting out of the editor with editable turned off.
Backspace and delete now largely work in an editor without a keymap.
Pressing backspace on iOS should now properly update the virtual keyboard's capitalize and autocorrect state.
Prevent random line-wrapping in (non-wrapping) editors on Mobile Safari.
Fix an issue in the compiled output that would break the code when minified with terser.
Fix an issue in the compiled output that would break the code when minified with terser.
Improve handling of bidi text with brackets (conforming to Unicode 13's bidi algorithm).
Improve handling of bidi text with brackets (conforming to Unicode 13's bidi algorithm).
Fix the position where drawSelection displays the cursor on bidi boundaries.
Fix an issue where the default focus ring gets obscured by the gutters and active line.
Fix an issue where the default focus ring gets obscured by the gutters and active line.
Fix an issue where the editor believed Chrome Android didn't support the CSS tab-size style.
Don't style active lines when there are non-empty selection ranges, so that the active line background doesn't obscure the selection.
Make iOS autocapitalize update properly when you press Enter.
Your coding agent can read these notes before it upgrades. Set up the MCP server →