Annotations get removed if a newline is added
See original GitHub issueIf one adds an annotations as a prop to the react ace component. They only get shown until I add a newline to the value. To show that problem I changed the example. The only thing I changed is adding annotations to the example/index.js
in line 29
. annotations={[{ row: 5, column: 2, type: 'error', text: 'Some error.'}]}
.
I got it to work if I put the render on line 24
into a function and call that function with the newValue
Full change starting on line 19
function onChange(newValue) {
console.log('change', newValue);
renderFirst(newValue);
}
function renderFirst(value = '') {
// Render first editor
render(
<AceEditor
mode="java"
theme="github"
name="blah1"
value={value}
annotations={[{ row: 5, column: 2, type: 'error', text: 'Some error.'}]}
height="6em"
onChange={onChange}
/>,
document.getElementById('example')
);
}
renderFirst();
I hope the description is clear, and I hope this is not me using the component wrong. Thanks in advance.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Platform specific newline character in annotation
Save this question. Show activity on this post. I'd like to use platform specific newline character in String provided in annotation element.
Read more >Python | Removing newline character from string
This task can also be executed using regex functions which can also perform the global replace of all the newline characters with an...
Read more >how to avoid the newline in figure annotation, please help. I ...
how to avoid the newline in figure annotation,... Learn more about annotation, newline, plot. ... Using cell string, each cell will be in...
Read more >Segmentation and newlines in ner.manual - Prodigy Support
I wish to display an entire length of contract while annotating using ner.manual in one go. Since Prodigy takes input from one file...
Read more >How to remove newlines from a string in Python 3?
If you have a string that contains multiple line breaks, you can use the replace method and get multiple newlines removed / replaced....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know I’m late to the party, but this might help: Try to set
editorProps={{$useWorker: false}}
on the editor component. This disables Ace’s internal annotations and prevents it from overriding custom annotations after newlines.Well, at least it fixed the very same issue for me. 😉