mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
fix: use isCollapsed
instead of rangeCount
(#3581)
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
export default function selectedText(body) {
|
export default function selectedText(body) {
|
||||||
const selection = window.getSelection();
|
const selection = window.getSelection();
|
||||||
|
|
||||||
if (selection?.rangeCount) {
|
if (!selection.isCollapsed) {
|
||||||
const range = selection.getRangeAt(0);
|
const range = selection.getRangeAt(0);
|
||||||
const parent = range.commonAncestorContainer;
|
const parent = range.commonAncestorContainer;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user