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

Open
opened 2026-04-08 23:49:13 +02:00 by marijnh · 0 comments
marijnh commented 2026-04-08 23:49:13 +02:00 (Migrated from gitlab.com)

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

No response

### 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_
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#7158
No description provided.