Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

284
Vistas
Draftjs space, backspace and double space crashing app

Does anyone had this issue before or knows how to fix the spacing/double spacing issue on draftjs ? I've spend couple of days trying to figure how to fix it but no luck. I saw couple suggestions from https://github.com/facebook/draft-js/issues/2422 but this still did not fix my problem.

Scenario one and steps to reproduce.

  1. Go to https://codesandbox.io/s/elegant-chatelet-1ozdw?file=/src/LinkAndUnlinkText/index.js.
  2. You will see default populated link on styled editor (looks like text field) and click/focus on the editor at end of the text try hit space keyboard one or try to do double space it removes the link then crashes the app. Visual test case see below.
  3. enter image description here

Scenario two and steps to reproduce.

  1. Go to https://codesandbox.io/s/elegant-chatelet-1ozdw?file=/src/LinkAndUnlinkText/index.js. and comment out line 393 function called handleBeforeInput and uncomment line 394 function called handleBeforeInput={(string, editorFromParam) => handleSpaceIssue(string, editorFromParam)}.
  2. Then click on editor/text field and try to type space at the end of the text. See below for visual test case.
  3. enter image description here

Second scenario works when handling manually but for some reason the UI can not detect the manual changes even after editorState update (see screenshot or open the dev console in sandbox). I would appreciate if someone advice anything I am running out of options. Thanks

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda