WebViewer Version: 10.2.2
How can I determine what annotation content is currently in focus?
For example, in the current screenshot, the annotation is selected, so I can move the annotation:
But on picture below the content is in focus
I would like to determine what annotation’s content is currently in focus
Could you clarify what you mean by “what annotation’s content is currently in focus”? In your third image, do you want to get the highlighted portion “AA”?
You check if the free text annotation is being focused with the hasFocus() API.
Here is the API documentation: Apryse WebViewer Class: RichTextEditor
As you can see, after I click on an annotation, I can move it in any direction. However, when I click twice on the text content, a Style popup appears, and I can change the content. If I try to move the annotation to a certain position, I will end up selecting the text instead of moving the annotation. And it’s correct behaviour
annotationManager.getSelectedAnnotations() - will return me a list of selected annotations.
I want to understand how to determine whether I can currently edit the content.
For example, if I select the annotation and then click the “ArrowDown” button, it will shift the annotation 5px downwards. But if I’m editing the text content within the annotation and click the “ArrowDown” button, it should move the cursor to the next line, not the annotation itself.
Therefore, I want to be able to distinguish whether I’m focusing on the text content (able to edit the content without requiring additional clicks on the annotation) or if I have simply selected the annotation
As mentioned in the previous response, you can check if the free text annotation is being focused with the hasFocus() API. Apryse WebViewer Class: RichTextEditor
Here is a video demonstration of the API on our showcase demo.
If the free text annotation is selected, you access the editor property and call the hasFocus API. If it returns true, you are currently focusing on the text content.
Hope this helps.