Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

getValue() not returning the text displayed in the editor itself #7158

@mjswan

Description

@mjswan

Describe the issue

We occasionally see cases where the call to getValue() returns the editor content prior to user modifications, rather than the user modified text. We've added console logging which displays the text returned by getValue() to which reveals the text does not match what the user sees in the editor. Once the editor is in this state, getValue() will stubbornly refuse to return the modified text.

Unfortunately, we don't have a reproducible case. However, users have reported the problem and we see the problematic behavior in their console log messages. It seems unlikely that getValue() is broken but we have no other explanation for the behavior and wonder if anyone else has experienced this issue.

This occurs using CodeMirror version 5.65.16 in a TypeScript-based web app. When it (infrequently) happens, it happens in Chrome on both macOS and Windows. Don't know if it happens on other browsers.

Browser and platform

No response

Reproduction link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions