Bugfix: How to fix drag shadow element getting stuck after drag ends...

Documentation for Sessions

🐛 Bugfix: How to fix drag shadow element getting stuck after drag ends...

Date: 2026-01-28
Time: 22:20:06 UTC
Session: editor2-73.15
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How to fix drag shadow element getting stuck after drag ends?

Task: Not specified


🎯 Decision Made

Chosen:

RAF cleanup + orphan shadow cleanup + retry mechanism for App Ready

Options Considered:


💭 Reasoning

The shadow element was getting stuck due to multiple issues: 1) RAF callback used a local variable that wasn't cancelled when stopMouseTracking was called - fixed by storing rafId on class and calling cancelAnimationFrame in cleanup. 2) Race conditions between host mouseup and AI_DRAG_END could leave orphaned shadows - fixed by adding cleanupLeftoverShadow() that finds elements by ID. 3) App Ready showed 'No' because embedded app sent ready message before host was listening - fixed by retrying ready message at 100ms, 300ms, 600ms intervals.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation