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

167
Views
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 answers
Answer question

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 Report
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!