I’m not entirely sure if I understood the issue. Could you please record a video of you reproducing the issue?
Also, I have some questions:
1 - What version of WebViewer are you using?
2 - The second code snippet (setToolMode function) is from your project or WebViewer?
3 - Can you reproduce the issue on one of our samples/demos?
=> As you can see I logged in console with “Internet explorer ie” and showing null.
=> First time it goes inside condition when select any tool from toolbar and again try to change tool then log is not displaying.
=> Yes, we’re trying to work in reactjs
I think we’ve some misscommunication related task discussion. I’m trying to explain again.
So we’re using pdftron webviewer for drawing annotation on any type of file.
For e.g. first choose pdf file
Select Elipse tool from toolbar and draw elipse annotation on pdf file so after draw it would selected and highlight on pdf and display their information on sidebar
Then we’re going to choose select tool for annotation selection purpose on pdf
So When as we click on select tool from toolbar then previous selected elipse annotation on pdf highlight gone (Step 2) and deselected
But we want it to remain selected whenever click on select tool after any tool drawn.
Yeah, I’m pretty sure this was what I’m trying to achieve with the code snippet provided.
I guess a little explanation will be handy: When you switch from one tool to another, this method switchOut is invoked. One of the things that happen inside its native implementation is a call to the deselectAllAnnotations API. What this code snippet does is just override the switchOut function without this API call.
Let me know if this works for you and if you have any further questions about it.
I guess you are assessing if the annotation is selected or not by the right panel having the annotation’s information or not. I’m afraid this might be related to something else, like, for example, you already having event listeners that populate the data on the right column. Also, I see you are still using 7.2, so that might be an issue.
My recommendation here is:
1 - Update WebViewer to 7.3
2 - Remove all customization and configuration over WebViewer and try the code I’ve sent previously
Let me know if it doesn’t work and we can move from there.