-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when DOM gets modified / restored #17
Comments
My Bad: This is NOT an issue with recogito-js. What I realized is that due to the DOM modification and restoration, the text coordinates have changed (addition of spaces and new line characters). Unfortunately I do not have control over this. Is it possible to determine annotations without using |
hm, yes. Dynamic changes to the DOM is something that RecogitoJS may not be very good at. Do you mean the same text might differ on re-render? I don't think there's a way to handle this. At least RecogitoJS will always base the selection on the text offset. Perhaps there's a way to keep the situation more stable between re-renders by using pre-formatted text? (Either by packing it into a https://github.com/recogito/recogito-js/wiki/API-Reference#initializing-recogitojs |
Hi @rsimon will try the pre mode and let you know |
pre is not an option as formatting is messed up. Will have to try a different solution so the text does not change. |
The page to which we are trying to integrate recogito-js has content organized in tabs. When the page loads the first time and some comments are loaded and the annotations are displayed properly. The recogito-js is initialised by attaching to the main div for this.
Subsequently let's assume user navigates to a different tab and back to tab 1, no annotations are shown. I guess this is due to the fact that the components annotated were destroyed when the tab navigation happened and restored when the tab was recreated. For testing, I added code to reload the comments when the tab 1 is recreated and shown. Now the annotation is shown but not all annotations are shown and its not shown in the right place.
Any idea about this? In general how to reload comments/annotations in case the DOM tree has changed?
The text was updated successfully, but these errors were encountered: