mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Quoting text selection across elements (#22974)
Regressed in https://github.com/discourse/discourse/pull/22802 Tests to follow next week
This commit is contained in:
parent
5d1a9a44c6
commit
28dc222e2f
@ -123,7 +123,10 @@ export function selectedText() {
|
||||
const div = document.createElement("div");
|
||||
for (let r = 0; r < selection.rangeCount; r++) {
|
||||
const range = selection.getRangeAt(r);
|
||||
const ancestor = range.commonAncestorContainer.parentElement;
|
||||
const ancestor =
|
||||
range.commonAncestorContainer.nodeType === Node.ELEMENT_NODE
|
||||
? range.commonAncestorContainer
|
||||
: range.commonAncestorContainer.parentElement;
|
||||
|
||||
// ensure we never quote text in the post menu area
|
||||
const postMenuArea = ancestor.querySelector(".post-menu-area");
|
||||
|
Loading…
Reference in New Issue
Block a user