I have a screen where the user needs to fill in a rich document (I'm using Ckeditor4) and at some point he can click on a list, and the item in that list should appear at the current cursor position in the rich text. I saw that it is possible to do it using JQuery, but I didn't find anything similar with React. Can anyone recommend me some documentation for this?
Here is the code I've made so far.
import { CKEditor } from "ckeditor4-react";
const TextEditor = () => {
function handleClick(fruit:string){
//add to CKEditor
}
return (
<>
<div>
{["Apple", "Banana", "Grape", "Pineapple"].map((item) => (
<button key={item} onClick={()=>handleClick(item)}></button>
))}
</div>
<CKEditor initData="<p>This is an example CKEditor 4 WYSIWYG editor instance.</p>" />
</>
);
};
export default TextEditor;