Skip to content

Commit

Permalink
fix identical line selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Jeanneney committed Aug 2, 2024
1 parent e90bc4c commit e1d9a0f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ function DocumentText(props: propsType): ReactElement {
) {
return [];
}
if (anchorNodeValue === focusNodeValue) {
//cette condition entraine un bug si on cherche a créer une annotation sur plusieurs lignes qui commence et qui termine par le même mot, en effet la condition sera vraie alors qu'il sagirat d'un anchor et d'un focus différent
// Check if selection in contained in one line
if (anchorNodeValue === focusNodeValue && !selectionText.includes('\n')) {
return [{ text: selectionText.trim(), index: computeSelectedTextIndex(selection) }];
}
return [];
Expand Down

0 comments on commit e1d9a0f

Please sign in to comment.