Skip to content

Commit

Permalink
allow placing the annotation element after the selected text
Browse files Browse the repository at this point in the history
  • Loading branch information
daliboris committed Aug 10, 2024
1 parent d58831d commit 1ae820f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pb-view-annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ class PbViewAnnotate extends PbView {
const endRange = rangeToPoint(range.endContainer, range.endOffset, 'end');
const adjustedRange = {
context: startRange.parent,
start: startRange.offset,
end: info.before ? startRange.offset : endRange.offset,
start: (info.position === 'after') ? endRange.offset : startRange.offset,
end: (info === undefined || info.position === 'before') ? startRange.offset : endRange.offset,
text: info.before ? '' : range.cloneContents().textContent,
before: info.before
};
Expand Down

0 comments on commit 1ae820f

Please sign in to comment.