Docs issue report from "features/collaboration/comments/comments-outside-editor.html"
Origin URL
https://ckeditor.com/docs/ckeditor5/41.3.0/features/collaboration/comments/comments-outside-editor.html
Project version
41.3.0
Is the information outdated? How?
The code samples show devs how to reach into components to manually update views. This seems a bit hacky, and likely prone to breakage in the future. I discovered that by simply calling attachTo on the thread returned via addCommentThread worked great.
Is there something missing in the guide? What is it?
No response
Is there anything else you would like to add?
No response
User agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0
Hi @ryanj-openquire
Could you please more preciesly specify which part of the documentation looks hacky, and how did you approach it?
Sure - this block of code from the handleNewCommentThread function:
// When an annotation is created or reopened we need to bound its focus manager with the field.
// Thanks to that, the annotation will be focused whenever the field is focused as well.
// However, this can be done only for one annotation, so we do it only if there are no open
// annotations for given field.
if ( !openThreads.length ) {
const threadView = commentsRepository._threadToController.get( thread ).view;
const annotation = annotations.collection.getByInnerView( threadView );
annotation.focusableElements.add( field );
}
I would prefer to not write code that is peering into internal properties in order to make this scenario perform well. If the above code is required by all integrations that use comments outside of the editor, then there should be supported API methods to implement the above.
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).