I noticed that when the TextAnnotatorPopup is rendered and I move to select text down rapidly - the finger can go over the floating element and cause the highlight flickering:
That's because the selection can accidentally go over the popup element that's portalled out of the annotatable content container at the bottom. So the selection just glues to its edge for a moment.
Changes Made
I added an idling listener that renders the popup only when there are no updates to the annotation's target for some time. The "update" is recognized when the quote updates. Otherwise, the popup shouldn't be concerned about the updates for the rest of the properties.
That prevents an accidental overlap with the user's touch and repositioning on the selection correction over the whitespace.
I also tried another alternative - making the popup act like the native context menu. However, its tracking turned out to be super unreliable and complex. So I retreated to a more pragmatic option.
Issue - https://github.com/recogito/text-annotator-js/issues/172
That's because the selection can accidentally go over the popup element that's portalled out of the annotatable content container at the bottom. So the selection just glues to its edge for a moment.
Changes Made
I added an idling listener that renders the popup only when there are no updates to the annotation's
target
for some time. The "update" is recognized when thequote
updates. Otherwise, the popup shouldn't be concerned about the updates for the rest of the properties. That prevents an accidental overlap with the user's touch and repositioning on the selection correction over the whitespace.I also tried another alternative - making the popup act like the native context menu. However, its tracking turned out to be super unreliable and complex. So I retreated to a more pragmatic option.