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.

Bug: cm.setValue("") over inclusive mark results in broken editor #5974

Closed

Description

@thomasjm

This one is a slightly weird edge case. Here's how to trigger it:

  1. Create a document with some content, and set a mark over the entire document with inclusiveLeft and inclusiveRight set to true.
  2. Call cm.setValue("")
  3. The editor will become empty, but it is now in a broken state where you can't type anything.

Here is a pen demonstrating this. Note that the setValue call happens in a timeout after 5 seconds.

Activity

  1. added a commit that references this issue on Aug 18, 2019
    79674d1
  2. thomasjm commented on Aug 18, 2019

    @thomasjm
    ContributorAuthor

    Thanks!

  3. thomasjm commented on Aug 18, 2019

    @thomasjm
    ContributorAuthor

    @marijnh I just tested with replaceRange instead of setValue and found the issue still exists in that case. Here's an updated pen:

    https://codepen.io/thomasjm/pen/QWLEmoY?editors=0010

    Should I open a new issue for this one?

  4. marijnh commented on Aug 19, 2019

    @marijnh
    Member

    Good point. Attached patch moves the fix to a more appropriate place.

  5. thomasjm commented on Aug 22, 2019

    @thomasjm
    ContributorAuthor

    Looks good, thanks again!

  6. added 2 commits that reference this issue on Jan 6, 2020
    fcbd47e
    d272064
  7. added a commit that references this issue on Jan 21, 2020
    2e3f6d4
  8. added a commit that references this issue on Sep 5, 2024
    19c620b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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