Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Tengo un problema con la funcionalidad de arrastrar y soltar en el editor React-draft-wysiwyg, no puedo concatenar la cadena mientras la suelto se actualiza

Estaba tratando de implementar la funcionalidad de arrastrar y soltar dentro del editor. Puedo arrastrar y soltar el valor dentro del editor, pero el problema es que cuando trato de soltar otro valor, la cadena no se concatena.

Codesandbox: lo que probé

 const EditorComponent = ({ editorState, setEditorState }) => { const onChange = async (value) => { setEditorState(value); }; const insertText = (text, editorValue) => { const currentContent = editorValue.getCurrentContent(); const currentSelection = editorValue.getSelection(); const newContent = Modifier.replaceText( currentContent, currentSelection, text ); const newEditorState = EditorState.push( editorValue, newContent, "insert-characters" ); return EditorState.forceSelection( newEditorState, newContent.getSelectionAfter() ); }; const sendTextToEditor = (text) => { setEditorState(insertText(text, editorState)); }; const [{ isOver }, drop] = useDrop(() => ({ accept: "button", drop: (item) => sendTextToEditor(item.id), collect: (monitor) => ({ isOver: !!monitor.isOver() }) })); return ( <div ref={drop}> <Editor editorState={editorState} ... onEditorStateChange={(value) => { onChange(value); }} /> </div> ); }; export default EditorComponent;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!