Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda