Skip to content

Type Editor


Type Editor / @type-editor/view / dom-observer/safari-shadow-selection-range

dom-observer/safari-shadow-selection-range

Functions

FunctionDescription

safariShadowSelectionRange

Workaround for Safari Selection/shadow DOM bug. Safari (at least in 2018-2022) doesn't provide regular access to the selection inside a shadowRoot, so we use execCommand to trigger a beforeInput event that gives us access to the selection range.

Based on https://github.com/codemirror/dev/issues/414 fix.