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 an issue where scrolling up through line-wrapped text would sometimes cause the scroll position to pop down.
Fix an issue where scrolling up through line-wrapped text would sometimes cause the scroll position to pop down.
Fix an issue where clicking wouldn't focus the editor on Firefox when it was in an iframe and already the active element of the frame.
Fix a bug that could cause compositions to be disrupted because their surrounding DOM was repurposed for some other piece of content.
Fix a bug where adding content to the editor could inappropriately move the scroll position.
Extend detection of Enter presses on Android to beforeInput events with an "insertLineBreak" type.
When dragging text inside the editor, look at the state of Ctrl (or Alt on macOS) at the time of the drop, not the start of drag, to determine whether
When dragging text inside the editor, look at the state of Ctrl (or Alt on macOS) at the time of the drop, not the start of drag, to determine whether to move or copy the text.
Fix an issue where having a bunch of padding on lines could cause vertical cursor motion and posAtCoords to jump over lines.
Block widget decorations can now be given an inlineOrder option to make them appear in the same ordering as surrounding inline widgets.
Fix an issue in scroll position stabilization for changes above the visible, where Chrome already does this natively and we ended up compensating twic
Fix an issue in scroll position stabilization for changes above the visible, where Chrome already does this natively and we ended up compensating twice.
Fix a bug where the cursor would in some circumstances be drawn on the wrong side of an inline widget.
Fix a bug where the cursor would in some circumstances be drawn on the wrong side of an inline widget.
Fix an issue where scrollPastEnd could cause the scroll position of editors that weren't in view to be changed unnecessarily.
Forbid widget decoration side values bigger than 10000, to prevent them from breaking range ordering invariants.
Forbid widget decoration side values bigger than 10000, to prevent them from breaking range ordering invariants.
Fix a bug where differences between widgets' estimated and actual heights could cause the editor to inappropriately move the scroll position.
Avoid another situation in which composition that inserts line breaks could corrupt the editor DOM.
Inline widgets may now introduce line breaks, if they report this through the WidgetType.lineBreaks property.
Remove an accidentally included console.log.
Remove an accidentally included console.log.
EditorViewConfig.dispatch is now passed the view object as a second argument.
Make sure pointer selection respects EditorView.atomicRanges.
Make sure pointer selection respects EditorView.atomicRanges.
Preserve DOM widgets when their decoration type changes but they otherwise stay in the same place.
Fix a bug in drawSelection that could lead to invisible or incorrect selections for a blank line below a block widget.
Fix a bug where the crosshairCursor extension could, when non-native key events were fired, trigger disruptive and needless view updates.
Fix a bug where the crosshairCursor extension could, when non-native key events were fired, trigger disruptive and needless view updates.
Fix an Android issue where backspacing at the front of a line with widget decorations could replace those decorations with their text content.
Respect scroll margins when scrolling the target of drag-selection into view.
Validate selection offsets reported by the browser, to work around Safari giving us invalid values in some cases.
Don't preserve the DOM around a composition that spans multiple lines.
Don't preserve the DOM around a composition that spans multiple lines.
Gutters now support a widgetMarker option that can be used to add markers next to block widgets.
Gutters now support a widgetMarker option that can be used to add markers next to block widgets.
Limit cursor height in front of custom placeholder DOM elements.
Limit cursor height in front of custom placeholder DOM elements.
Fix a crash in drawSelection when a measured position falls on a position that doesn't have corresponding screen coordinates.
Fix a crash in drawSelection when a measured position falls on a position that doesn't have corresponding screen coordinates.
Work around unhelpful interaction observer behavior that could cause the editor to not notice it was visible.
Give the cursor next to a line-wrapped placeholder a single-line height.
Make sure drop events below the editable element in a fixed-height editor get handled properly.
Widget decorations can now define custom coordsAtPos methods to control the way the editor computes screen positions at or in the widget.
Fix an issue where, when escape was pressed followed by a key that the editor handled, followed by tab, the tab would still move focus.
Fix an issue where, when escape was pressed followed by a key that the editor handled, followed by tab, the tab would still move focus.
Fix an issue where, in some circumstances, the editor would ignore text changes at the end of a composition.
Allow inline widgets to be updated to a different length via updateDOM.
Avoid disrupting the composition in specific cases where Safari invasively changes the DOM structure in the middle of a composition.
Avoid disrupting the composition in specific cases where Safari invasively changes the DOM structure in the middle of a composition.
Fix a bug that prevented destroy being called on hover tooltips.
Fix a bug where the editor could take focus when content changes required it to restore the DOM selection.
Fix height layout corruption caused by a division by zero.
Make sure styles targeting the editor's focus status are specific enough to not cause them to apply to editors nested inside another focused editor. This will require themes to adjust their selection background styles to match the new specificity.
Make the editor scroll while dragging a selection near its sides, even if the cursor isn't outside the scrollable element.
Make the editor scroll while dragging a selection near its sides, even if the cursor isn't outside the scrollable element.
Fix a bug that interrupted composition after widgets in some circumstances on Firefox.
Make sure the last change in a composition has its user event set to input.type.compose, even if the compositionend event fires before the changes are applied.
Make it possible to remove additional selection ranges by clicking on them with ctrl/cmd held, even if they aren't cursors.
Keep widget buffers between widgets and compositions, since removing them confuses IME on macOS Firefox.
Fix a bug where, for DOM changes that put the selection in the middle of the changed range, the editor incorrectly set its selection state.
Fix a bug where coordsAtPos could return a coordinates before the line break when querying a line-wrapped position with a positive side.
Work around a Firefox issue that caused coordsAtPos to return rectangles with the full line height on empty lines.
Work around a Firefox issue that caused coordsAtPos to return rectangles with the full line height on empty lines.
Opening a context menu by clicking below the content element but inside the editor now properly shows the browser's menu for editable elements.
Fix an issue that broke composition (especially of Chinese IME) after widget decorations.
Fix an issue that would cause the cursor to jump around during compositions inside nested mark decorations.
Work around a Firefox CSS bug that caused cursors to stop blinking in a scrolled editor.
Work around a Firefox CSS bug that caused cursors to stop blinking in a scrolled editor.
Fix an issue in drawSelection where the selection extended into the editor's padding.
Fix pasting of links copied from iOS share sheet.
Improve the way posAtCoords picks the side of a widget to return by comparing the coordinates the center of the widget.
Improve the way posAtCoords picks the side of a widget to return by comparing the coordinates the center of the widget.
Fix an issue where transactions created for the focusChangeEffect facet were sometimes not dispatched.
Fix an issue where inaccurate estimated vertical positions could cause the viewport to not converge in line-wrapped editors.
Fix an issue where inaccurate estimated vertical positions could cause the viewport to not converge in line-wrapped editors.
Don't suppress double-space to period conversion when autocorrect is enabled.
Make sure the measuring code notices when the scaling of the editor is changed, and does a full measure in that case.
The new EditorView.focusChangeEffect facet can be used to dispatch a state effect when the editor is focused or blurred.
Fix an issue where tooltips that have their height reduced have their height flicker when scrolling or otherwise interacting with the editor.
Fix an issue where tooltips that have their height reduced have their height flicker when scrolling or otherwise interacting with the editor.
Fix a regression that caused clicking on the scrollbar to move the selection.
Fix a regression that caused clicking on the scrollbar to move the selection.
Fix an issue where focus or blur event handlers that dispatched editor transactions could corrupt the mouse selection state.
Fix a CSS regression that prevented the drop cursor from being positioned properly.
WidgetType.updateDOM is now passed the editor view object.
Fix a bug in posAtCoords that could cause incorrect results for positions to the left of a wrapped line.
Fix a bug in posAtCoords that could cause incorrect results for positions to the left of a wrapped line.
Fix a regression where the cursor didn't restart its blink cycle when moving it with the pointer.
Fix a regression where the cursor didn't restart its blink cycle when moving it with the pointer.
Even without a key property, measure request objects that are already scheduled will not be scheduled again by requestMeasure.
Fix an issue where keymaps incorrectly interpreted key events that used Ctrl+Alt modifiers to simulate AltGr on Windows.
Fix a bug where line decorations with a different class property would be treated as equal.
Fix a bug that caused drawSelection to not notice when it was reconfigured.
Fix a crash in the gutter extension caused by sharing of mutable arrays.
Fix a regression that caused touch selection on mobile platforms to not work in an uneditable editor.
Fix a bug where DOM events on the boundary between lines could get assigned to the wrong line.
Make the editor properly scroll when moving the pointer out of it during drag selection.
Make the editor properly scroll when moving the pointer out of it during drag selection.
Fix a regression where clicking below the content element in an editor with its own height didn't focus the editor.
Make the editor notice widget height changes to automatically adjust its height information.
Make the editor notice widget height changes to automatically adjust its height information.
Fix an issue where widget buffers could be incorrectly omitted after empty lines.
Fix an issue in content redrawing that could cause coordsAtPos to return incorrect results.
The static RectangleMarker.forRange method exposes the logic used by the editor to draw rectangles covering a selection range.
Layers can now provide a destroy function to be called when the layer is removed.
The new highlightWhitespace extension makes spaces and tabs in the editor visible.
The highlightTrailingWhitespace extension can be used to make trailing whitespace stand out.
The layer function can now be used to define extensions that draw DOM elements over or below the document text.
The layer function can now be used to define extensions that draw DOM elements over or below the document text.
Tooltips that are bigger than the available vertical space for them will now have their height set so that they don't stick out of the window. The new resize property on TooltipView can be used to opt out of this behavior.
Fix a bug that caused marked unnecessary splitting of mark decoration DOM elements in some cases.
Fix a bug that caused marked unnecessary splitting of mark decoration DOM elements in some cases.
Fix an issue where key bindings were activated for the wrong key in some situations with non-US keyboards.
Fix an issue where key bindings were activated for the wrong key in some situations with non-US keyboards.
A tooltip's positioned callback is now passed the available space for tooltips.
Typing into a read-only editor no longer moves the cursor.
Typing into a read-only editor no longer moves the cursor.
Fix an issue where hover tooltips were closed when the mouse was moved over them if they had a custom parent element.
Fix an issue where the editor could end up displaying incorrect height measurements (typically after initializing).
Fix an issue where coordinates next to replaced widgets were returned incorrectly, causing the cursor to be drawn in the wrong place.
Fix an issue where coordinates next to replaced widgets were returned incorrectly, causing the cursor to be drawn in the wrong place.
Update the crosshairCursor state on every mousemove event.
Avoid an issue in the way that the editor enforces cursor associativity that could cause the cursor to get stuck on single-character wrapped lines.
Avoid an issue where scrollPastEnd makes a single-line editor have a vertical scrollbar.
Avoid an issue where scrollPastEnd makes a single-line editor have a vertical scrollbar.
Work around a Chrome bug where it inserts a newline when you press space at the start of a wrapped line.
Align rectangularSelection's behavior with other popular editors by making it create cursors at the end of lines that are too short to touch the rectangle.
Fix an issue where coordinates on mark decoration boundaries were sometimes taken from the wrong side of the position.
Prevent scrolling artifacts caused by attempts to scroll stuff into view when the editor isn't being displayed.
TooltipView objects can now provide a destroy method to be called when the tooltip is removed.
Fix a crash when trying to scroll something into view in an editor that wasn't in the visible DOM.
Fix a crash when trying to scroll something into view in an editor that wasn't in the visible DOM.
Fix an issue where coordsAtPos returned the coordinates on the wrong side of a widget decoration wrapped in a mark decoration.
Fix an issue where content on long wrapped lines could fail to properly scroll into view.
Fix an issue where DOM change reading on Chrome Android could get confused when a transaction came in right after a beforeinput event for backspace, enter, or delete.
Reduce the amount of wrap-point jittering when scrolling through a very long wrapped line.
Reduce the amount of wrap-point jittering when scrolling through a very long wrapped line.
Fix an issue where scrolling to content that wasn't currently drawn due to being on a very long line would often fail to scroll to the right position.
Suppress double-space-adds-period behavior on Chrome Mac when it behaves weirdly next to widget.
Key binding objects with an any property will now add handlers that are called for any key, within the ordering of the keybindings.
Don't override double/triple tap behavior on touch screen devices, so that the mobile selection menu pops up properly.
Don't override double/triple tap behavior on touch screen devices, so that the mobile selection menu pops up properly.
Fix an issue where updating the selection could crash on Safari when the editor was hidden.
Highlight the active line even when there is a selection. Prevent the active line background from obscuring the selection backdrop.
Highlight the active line even when there is a selection. Prevent the active line background from obscuring the selection backdrop.
Fix an issue where elements with negative margins would confuse the editor's scrolling-into-view logic.
Fix scrolling to a specific position in an editor that has not been in view yet.
Fix a bug where cursor motion, when starting from a non-empty selection range, could get stuck on atomic ranges in some circumstances.
Fix a bug where cursor motion, when starting from a non-empty selection range, could get stuck on atomic ranges in some circumstances.
Avoid triggering Chrome Android's text-duplication issue when a period is typed in the middle of a word.
Don't reset the selection for selection change events that were suppressed by a node view.
Don't reset the selection for selection change events that were suppressed by a node view.
Don't use the global document variable to track focus, since that doesn't work in another window/frame.
Don't use the global document variable to track focus, since that doesn't work in another window/frame.
Fix an issue where key handlers that didn't return true were sometimes called twice for the same keypress.
Avoid editing glitches when using deletion keys like ctrl-d on iOS.
Properly treat characters from the 'Arabic Presentation Forms-A' Unicode block as right-to-left.
Work around a Firefox bug that inserts text at the wrong point for specific cross-line selections.
Fix a bug where posAtCoords would return the wrong results for positions to the right of wrapped lines.
Fix a bug where posAtCoords would return the wrong results for positions to the right of wrapped lines.
The new EditorView.setRoot method can be used when an editor view is moved to a new document or shadow root.
Make selection-restoration on focus more reliable.
Make selection-restoration on focus more reliable.
Fix a bug where a document that contains only non-printing characters would lead to bogus text measurements (and, from those, to crashing).
Fix a bug where a document that contains only non-printing characters would lead to bogus text measurements (and, from those, to crashing).
Make sure differences between estimated and actual block heights don't cause visible scroll glitches.
Fix an issue where double tapping enter to confirm IME input and insert a newline on iOS would sometimes insert two newlines.
Fix an issue where double tapping enter to confirm IME input and insert a newline on iOS would sometimes insert two newlines.
Fix an issue on iOS where a composition could get aborted if the editor scrolled on backspace.
Make highlightSpecialChars replace directional isolate characters by default.
Make highlightSpecialChars replace directional isolate characters by default.
The editor will now try to suppress browsers' native behavior of resetting the selection in the editable content when the editable element is focused (programmatically, with tab, etc).
Fix a CSS issue that made it possible, when the gutters were wide enough, for them to overlap with the content.
MatchDecorator now supports a decorate option that can be used to customize the way decorations are added for each match.
MatchDecorator now supports a decorate option that can be used to customize the way decorations are added for each match.
Fix a problem where posAtCoords could incorrectly return the start of the next line when querying positions between lines.
Fix a problem where posAtCoords could incorrectly return the start of the next line when querying positions between lines.
Fix an issue where registering a high-precedence keymap made keymap handling take precedence over other keydown event handlers.
Ctrl/Cmd-clicking can now remove ranges from a multi-range selection.
Fix a CSS issue that broke horizontal scroll width stabilization.
Fix a CSS issue that broke horizontal scroll width stabilization.
Fix a bug where defaultLineHeight could get an incorrect value in very narrow editors.
Avoid DOM selection corruption when the editor doesn't have focus but has selection and updates its content.
Avoid DOM selection corruption when the editor doesn't have focus but has selection and updates its content.
Fall back to dispatching by key code when a key event produces a non-ASCII character (so that Cyrillic and Arabic keyboards can still use bindings specified with Latin characters).
The new static EditorView.findFromDOM method can be used to retrieve an editor instance from its DOM structure.
The new static EditorView.findFromDOM method can be used to retrieve an editor instance from its DOM structure.
Instead of passing a constructed state to the EditorView constructor, it is now also possible to inline the configuration options to the state in the view config object.
Fix an issue on Chrome Android where the DOM could fail to display the actual document after backspace.
Fix an issue on Chrome Android where the DOM could fail to display the actual document after backspace.
Avoid an issue on Chrome Android where DOM changes were sometimes inappropriately replace by a backspace key effect due to spurious beforeinput events.
Fix a problem where the content element's width didn't cover the width of the actual content.
Work around a bug in Chrome 102 which caused wheel scrolling of the editor to be interrupted every few lines.
Make sure the editor re-measures itself when its attributes are updated.
Make sure the editor re-measures itself when its attributes are updated.
Fix an issue where gutter elements without any markers in them would not get the cm-gutterElement class assigned.
Fix an issue where gutter elements without any markers in them would not get the cm-gutterElement class assigned.
Fix an issue where DOM event handlers registered by plugins were retained indefinitely, even after the editor was reconfigured.
Prevent Mac-style behavior of inserting a period when the user inserts two spaces.
Prevent Mac-style behavior of inserting a period when the user inserts two spaces.
Fix an issue where the editor would sometimes not restore the DOM selection when refocused with a selection identical to the one it held when it lost focus.
Fix a bug where the input handling could crash on repeated (or held) backspace presses on Chrome Android.
Fix a bug where the input handling could crash on repeated (or held) backspace presses on Chrome Android.
The new hideOn option to hoverTooltip allows more fine-grained control over when the tooltip should hide.
The new hideOn option to hoverTooltip allows more fine-grained control over when the tooltip should hide.
Remove debug statements that accidentally made it into 0.20.0.
Remove debug statements that accidentally made it into 0.20.0.
Fix a regression in moveVertically.
The deprecated interfaces blockAtHeight, visualLineAtHeight, viewportLines, visualLineAt, scrollPosIntoView, scrollTo, and centerOn were removed from…
The deprecated interfaces blockAtHeight, visualLineAtHeight, viewportLines, visualLineAt, scrollPosIntoView, scrollTo, and centerOn were removed from the library.
All decorations are now provided through EditorView.decorations, and are part of a single precedence ordering. Decoration sources that need access to the view are provided as functions.
Atomic ranges are now specified through a facet (EditorView.atomicRanges).
Scroll margins are now specified through a facet (EditorView.scrollMargins).
Plugin fields no longer exist in the library (and are replaced by facets holding function values).
This package no longer re-exports the Range type from @codemirror/state.
Fix a bug where zero-length block widgets could cause viewportLineBlocks to contain overlapping ranges.
The new perLineTextDirection facet configures whether the editor reads text direction per line, or uses a single direction for the entire editor. EditorView.textDirectionAt returns the direction around a given position.
rectangularSelection and crosshairCursor from @codemirror/rectangular-selection were merged into this package.
This package now exports the tooltip functionality that used to live in @codemirror/tooltip.
The exports from the old @codemirror/panel package are now available from this package.
The exports from the old @codemirror/gutter package are now available from this package.
Fix an issue where DOM syncing could crash when a DOM node was moved from a parent to a child node (via widgets reusing existing nodes).
Fix an issue where DOM syncing could crash when a DOM node was moved from a parent to a child node (via widgets reusing existing nodes).
To avoid interfering with things like a vim mode too much, the editor will now only activate the tab-to-move-focus escape hatch after an escape press that wasn't handled by an event handler.
Make sure the view measures itself before the page is printed.
Tweak types of view plugin defining functions to avoid TypeScript errors when the plugin value doesn't have any of the interface's properties.
Fix an issue where block widgets at the start of the viewport could break height computations.
Fix an issue where block widgets at the start of the viewport could break height computations.
Fix a bug where block widgets on the edges of viewports could cause the positioning of content to misalign with the gutter and height computations.
Fix a bug where block widgets on the edges of viewports could cause the positioning of content to misalign with the gutter and height computations.
Improve cursor height next to widgets.
Fix a bug where mapping positions to screen coordinates could return incorred coordinates during composition.
Fix an issue where the library failed to call WidgetType.destroy on the old widget when replacing a widget with a different widget of the same type.
Fix an issue where the library failed to call WidgetType.destroy on the old widget when replacing a widget with a different widget of the same type.
Fix an issue where the editor would compute DOM positions inside composition contexts incorrectly in some cases, causing the selection to be put in the wrong place and needlessly interrupting compositions.
Fix leaking of resize event handlers.
Your coding agent can read these notes before it upgrades. Set up the MCP server →