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

114
Vistas
Exit from a custom element style in ContentEditable after press CTRL+ENTER key in React

I'm trying to create a website like medium.com and I have a page that I can create a new post with tools (bold,italic,insert image,add quote,add code) and I create styles for these elements like the below image created for quote text.

enter image description here

when I press the Enter key this block expands correctly. and I want to exit this block when pressing CTRL + ENTER. I wrote this code to handle it.

if (e.ctrlKey && (e.keyCode == 13 || e.keyCode == 10)) {
    document.execCommand('insertParagraph');
    e.preventDefault()

}

but when I press CTRL+KEY the last style doesn't destroy. and new line created with the last quote style. actually create new blockquote tag in the new line.

enter image description here

How can I fix it? 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