Skip to content

Draft: SUP-4315: Fix attaching <span class="atwho-query"></span>

Oleg Didkovskyi requested to merge SUP-4315-fix-user-mentioning into master

Ticket: https://pepper-com.atlassian.net/browse/SUP-4315

Fix attaching <span class="atwho-query">. Range Interface has to be a single text node otherwise position of @ calculated incorrectly.

Range.commonAncestorContainer is not a TextNode when:
— redactor is empty, then Range.commonAncestorContainer is redactor element by itself
— user selects range of text in the redactor, Range.startContainer and Range.endContainer might be a different elements and commonAncestorContainer will be the redactor element
— the cursor in redactor is on the last empty string, in that case the Range.commonAncestorContainer is also redactor element

Edited by Oleg Didkovskyi

Merge request reports

Loading