recogito / text-annotator-js

A JavaScript library for text annotation.
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

⚠️ Fixed processing of the selection range made totally outside of the container ⚠️ #150

Open oleksandr-danylchenko opened 1 month ago

oleksandr-danylchenko commented 1 month ago

Issue

When the selection range was made entirely outside of the container - we should treat it as a collapsed one and discard it. However, this wasn't the case with the trimRangeToContainer method I introduced in https://github.com/recogito/text-annotator-js/pull/134. Instead, it would make the outside range cover the container ⚠️

image