Hi,
When we add an arrow annotation, the pdf viewer automatically sets focus to comment box on comment panel. My questions are:
While adding the
annotations the comment box on comment panel is focused automatically when the
comment panel is open is the behaviour of the PDF Viewer. If you can elaborate
your requirement as why do you need not to focus the comment panel while adding
the arrow annotation, we will check its feasibility to consider or not, or to suggest
alternate option to achieve your requirement.
As per my requirement, we do not want to add any comment for line/arrow annotation.
If there is a workaround to not focus the comment panel while adding the line/arrow annotation it is fine for now.
Refer the below code snippet and sample to achieve your requirement. In the given sample, we are disabling the comment panel for line and arrow annotations alone while adding and selecting annotations.
Code snippet:
public annotationAdd(args){ var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
// Disble comment panel for line and arrow annotations alone. if ((args.annotationType === "Line") || args.annotationType === "Arrow"){ console.log(args); viewer.enableCommentPanel = false; } else{ viewer.enableCommentPanel = true; } }
public annotationSelect(args){ var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
// Disble comment panel for line and arrow annotations alone. if ((args.annotation.subType === "Line") || args.annotation.subType === "Arrow"){ console.log(args); viewer.enableCommentPanel = false; } else{ viewer.enableCommentPanel = true; } }
|
Thanks for your reply and suggestion. However, it is not working as expected. For example, if we have comment panel open and add/select a line annotation, it hides the comment panel. Similarly lets say you have a comment panel open and you are checking the comments, if there is a comment for line annotation and click on it, it hides the comment pa
Refer the below code snippet and sample for not to disable the comment panel while clicking the line/arrow annotation comments.
Code snippet:
public annotationSelect(args){ var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0]; console.log(args);
// Disble comment panel for line and arrow annotations alone. if ((args.annotation.subType === "Line" || args.annotation.subType === "Arrow") && (!args.isProgrammaticSelection)){ viewer.enableCommentPanel = false; } else{ viewer.enableCommentPanel = true; } } |
Note: While selecting the line/arrow annotations the comment panel is disabled.