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

149
Views
press 'done' button on mobile keyboard is not trigger close in contenteditable div

I have a div that use contenteditable = "true", when i use mobile device like iphone and click this div (focus this div), keyboard will open. But when I click "done" button on keyboard (not return/enter), the keyboard can't close. How can I close the keyboard when I click "done" button. Any ideas what I'm doing wrong?

document.getElementById('send-msg-content').addEventListener("keypress", function( event ) {
  alert('keypress');
}, true);

document.getElementById('send-msg-content').addEventListener("keydown", function( event ) {
  alert('keydown');
}, true);

document.getElementById('send-msg-content').addEventListener("keyup", function( event ) {
  alert('keyup');
}, true);
.send-msg-content{
    -moz-user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    -khtml-user-select: text;
    user-select: text;
    border:1px solid blue;
    resize: none;
}

.send-msg-content:empty:before {
    content: attr(placeholder);
    color: #aaa;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    line-height: 1em;
    pointer-events:none;
}
<div oncontextmenu="return false;" contenteditable="true" placeholder="talk something" class="send-msg-content" id="send-msg-content" inputmode="text"></div>

This gif file is my operation situation:

enter image description here

about 4 years ago · Juan Pablo Isaza
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!