Range is Null or Not Collapsed Error Thrown When User Attempts to Add a Second Inline Task Without Clearing the Task Helper Text

Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When editing an article, if you highlight something and then start typing (replacing that character or set of characters with something else), you get a Javascript error. We had this problem on version 4.2.13, and after upgrading to version 4.3.

The Javascript error is "range is null or not collapsed"

Cause

It is caused when you select content and type Enter. There's a Char 13 handler triggered on keypress, where getTextFromPreviousSiblingTextNodes(range) doesn't expect the range to select several characters (it expects a caret).

Affected Browsers:

  • Chrome

  • IE

  • Mozilla

    Affects version:

  • 5.0

  • 4.3

  • 4.2

Resolution

This was fixed in Version 4.3.7 of Confluence, and the bug report follows as https://jira.atlassian.com/browse/CONFDEV-10170

Updated on April 21, 2026

Still need help?

The Atlassian Community is here for you.