Type Editor / @type-editor/selection-util / has-selection
has-selection
Functions
| Function | Description |
|---|---|
Checks if the editor contains a valid DOM selection. This function verifies that:
Text nodes (nodeType === 3) are checked via their parent element. This is wrapped in a try-catch because Firefox throws 'permission denied' errors when accessing properties of nodes in generated CSS elements. |