Comments (4)
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
the TextPositionSelector with offset/length?
from recogito-js.
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 <pre>
tag, or by applying a white-space: pre;
style. In this case, trying the two different mode
settings that RecogitoJS provides might help:
https://github.com/recogito/recogito-js/wiki/API-Reference#initializing-recogitojs
from recogito-js.
Hi @rsimon will try the pre mode and let you know
from recogito-js.
pre is not an option as formatting is messed up.
Will have to try a different solution so the text does not change.
from recogito-js.
Related Issues (20)
- Creating annotation does not seem to work when target element is in iframe HOT 3
- The editor does not allow selection of text in readonly mode HOT 3
- Uncaught DOMException: Failed to execute 'setEnd' on 'Range': The offset [...] is invalid
- Annotate text in text area? HOT 5
- Raise error when double clicking at the end of the paragraph HOT 1
- Unknown file extension ".css" HOT 4
- Not recognizing specific characters such as ยง HOT 2
- Choose annotatable items, not all wrapped items
- ERROR in ./node_modules/@recogito/recogito-js/dist/recogito.min.css HOT 1
- Support for Vue and Typescript? HOT 1
- getAnnotations doesn't work when annotating content in iframe
- Highlighting collapses completely HOT 5
- Two annotations on the exact same piece of text HOT 4
- Tags as buttons HOT 2
- Dropdown closes even if the input has content HOT 3
- Raise external 'cancelAnnotation' event
- "mouseup" event considered even for context menu action HOT 1
- Prevent creation of zero-width SPANs HOT 2
- Rendering highlights becomes painfully slow for longer documents HOT 1
- Autocomplete for relations does not work as intended HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recogito-js.