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

171
Visualizações
contenteditable moves the cursor outside the block

if you place another html block with the contenteditable="false" attribute in the contenteditable block, then the cursor moves outside the block as shown in the screenshot.

enter image description here

Try to start removing the word "remove" in the example. And the cursor will go beyond the block. Is it possible to solve this problem?

http://jsfiddle.net/weckdjp4/

.test-block {
  display: inline-block;
  height: 30px;
  border: 1px solid red;
  padding: 2px;
}

.content {
  width: 80%;
  border: 1px solid #CCC;
  padding: 10px;
}
<div class="content" contenteditable="true" id="test">hi <div class="test-block" contenteditable="false">test</div>remove</div>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add box-sizing: border-box; to .content:

.content {
  width: 80%;
  border: 1px solid #CCC;
  padding: 10px;
  box-sizing: border-box;
}
about 4 years ago · Juan Pablo Isaza Relatório
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