Search code examples
javascripthtmlsafarimouseeventdrag-event

DragEvent.relatedTarget returns null in Safari


If I try to check e.relatedTarget for dragleave event, in Safari (v14.1.2) it is always null.
You can see it here (add console.log) — https://jsfiddle.net/zfnj5rv4
In Chrome it works fine.

This page says that Safari supports MouseEvent.relatedTarget.
This page says that DragEvent inherits properties from MouseEvent and Event.

Is it broken or never worked?


Solution

  • Looks like it's a longstanding bug in webkit: https://bugs.webkit.org/show_bug.cgi?id=66547