Case ce-0154-image-drag-drop-position · Scenario scenario-image-insertion

Image drop position is incorrect in drag and drop

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
image drag-drop position chrome

Phenomenon

When dragging and dropping an image file into a contenteditable element in Chrome, the image may be inserted at an incorrect position. The drop position does not match the cursor position or drop location.

Reproduction example

  1. Create contenteditable with text
  2. Place cursor at a specific position
  3. Drag and drop an image file

Observed behavior

  • Image is inserted at wrong position
  • Drop position does not match cursor
  • Or image is inserted at end of content
  • Position is unpredictable

Expected behavior

  • Image should be inserted at drop location
  • Or at cursor position
  • Position should be predictable
  • Drop should work intuitively

Browser Comparison

  • Chrome/Edge: Position may be incorrect (this case)
  • Firefox: Similar position issues
  • Safari: Drop position most unpredictable

Notes and possible direction for workarounds

  • Intercept drop event
  • Calculate drop position from event coordinates
  • Insert image at calculated position
  • Use document.caretRangeFromPoint if available
Before
Hello World
Text, cursor positioned between 'Hello' and 'World'
After Drop (Bug)
Hello WorldImage
Image inserted at end regardless of drop position
vs
✅ Expected
Hello Image World
Expected: Image inserted at drop position (cursor position)

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0103-image-paste-chrome Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0154-image-drag-drop-position Windows 11 Desktop or Laptop Any Chrome 120.0 US draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.