Clear Highlight on Annotation Tool

Hello,

I'm currently in the process of building an app that allows a user to highlight a piece of text and then give it a tag using the annotation component. After the user provides the annotation, they click submit and a new piece of text appears in the annotation component. The issue that I'm having is that the highlight from the previous annotation is still present. Since the annotation component does not seem to have a clear/reset method, I'm not sure how best to clear the previous highlight. Any advice is much appreciated!

First highlight:

Second (Incorrect) Highlight:

Hello!, you can have a query that returns the following:

return [{"start": 0, "end": 0}]

and set tags to be yourQuery.data

then when your button Next Annotation is clicked, trigger the query (yourQuery.trigger()) and it will reset the tags

Animation

1 Like

Thank you, that did exactly what I needed it to!

1 Like