Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:19:50+00:00 2026-06-06T16:19:50+00:00

When dragging something over a contenteditable area in Chrome, to be able to catch

  • 0

When dragging something over a contenteditable area in Chrome, to be able to catch the ‘drop’ event, one needs to call e.preventDefault(); on every ‘dragover’ event.

This hides the caret, which tells you where you are going to drop. This can be circumvented by manually updating the caret position via document.caretRangeFromPoint().

This works perfectly unless the window is inactive – then the caret is invisible.

Fiddle: http://jsfiddle.net/zupa/mezAm/

Is there a way to make it visible without using a helper?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:19:51+00:00Added an answer on June 6, 2026 at 4:19 pm

    It turns out you don’t HAVE TO call e.preventDefault() in the dragover event, which leaves you with the cursor shown even if the window is inactive. (So the default browser behaviour is to show the drop caret.) All the tutorials state that you MUST call it to be able to catch the drop event. I believe you only need to return false.

    I have only tested that with Firefox 13.0.1 and Chrome 19.0.1084.56 (Other browsers have not yet implemented the drop event as per now.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The user is dragging something over my TcxGrid component. How can I know which
I'm dragging an item from a surfacelistbox over something else, let's say for example
I using HTML5 D&D. I have one parent drop area, e.g. parent. In that
After dragging two tables in from one database, I switch to another and drag
I'm creating a drag and drop image environment, where if you hover over an
Something like dragging and dropping an image Is there a basic sample that I
I've got a grid of pictures that I want to be able to drag/drop
I want to allow the user to specify the location of something by dragging
How to prevent draggable child elements from dragging over each other in absolute position?
I would like to do something when a scroll event has occurred on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.