Issue with the undo and redo flow of text annotations

Product: pdftron/webviewer

Product Version: 8.12.0

Please give a brief summary of your issue:
Issue with the undo and redo flow of text annotations.

Please describe your issue and provide steps to reproduce it:

I’m currently working on an issue with the undo and redo functions. Let me describe the issue and attach a video to demonstrate it:

The text annotation is initially displayed as a placeholder “Insert text here” to allow the user to enter content. However, when the “Undo” button is pressed, the text annotation doesn’t get deleted immediately; it reverts back to the “Insert text here” placeholder state. Subsequently, the user needs to press the undo button again to fully remove the text annotation. This behavior is observed in both the undo and redo processes.

Is there a way to prevent this behavior? or Is there a way to bypass the placeholder state (‘Insert text here’) and directly enter the editing state?
I would like to be able to delete or redo the text annotation on the first press of the undo or redo button.

Thank you in advance.

1 Like

Hi @catalina.gonzalez,

Thanks for reaching out to WebViewer Support! There doesn’t seem to be any obvious APIs available under Core.AnnotationHistoryManager that will tell you if the undo state will go back to “Insert Text Here” so this may be a feature request. I will take a closer look and see if we can find a way for you to customize the behaviour to delete the annotation.

I appreciate your patience in the meantime.

Thanks,
Adam

2 Likes

Hi @catalina.gonzalez,

Thank you for your patience while I looked further into this. Unfortunately there does not seem to be a workaround to ignore the initial “Insert Text Here” state so I have added this as a feature request to our backlog. At this time I cannot provide a timeline when this will be implemented but we’ll do our best to keep you updated as progress is made! If you have a desired timeline for this fix please let us know and I’ll include it in the feature request.

Please let me know if you have any further questions!

Thanks,
Adam

1 Like