Scenario

Selection performance in large contenteditable documents

getSelection(), getRangeAt, and DOM walks over very large contenteditable trees can block the main thread when the user selects all or drags across thousands of nodes—mobile devices suffer first.

performance
Scenario ID
scenario-performance-selection-large-content

Details

getSelection(), getRangeAt, and DOM walks over very large contenteditable trees can block the main thread when the user selects all or drags across thousands of nodes—mobile devices suffer first.

References

Scenario flow

Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.

React Flow mini map

Variants

Each row is a concrete case for this scenario, with a dedicated document and playground.

Case OS Device Browser Keyboard Status
ce-0226-selection-performance-large Any Any Desktop Any Any Any US QWERTY draft

Cases

Open a case to see the detailed description and its dedicated playground.

Related Scenarios

Other scenarios that share similar tags or category.

Tags: performance, selection

Virtual scrolling libraries interfere with contenteditable selection

When a contenteditable element is used with virtual scrolling libraries (e.g., for large documents), the virtual scrolling mechanism may interfere with text selection and caret positioning. The selection may be lost when elements are removed from the DOM during scrolling.

1 case
Tags: performance

CSS will-change may improve or degrade contenteditable performance

When a contenteditable element has CSS will-change property set, performance may be affected. In some cases, it may improve performance by hinting the browser about upcoming changes. In other cases, it may degrade performance by creating unnecessary layers.

1 case

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.