Can't create DragEvent with constructor

Won’t fix Issue #14156632

Details

Author
Steven A.
Created
Oct 10, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
40.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

This is similar to issue #7598786. I can’t instantiate a DragEvent by calling the constructor. See console:

typeof DragEvent
“function”
new DragEvent("", null)
Function expected

Note however, that this appears to work for MouseEvent objects, like this:

new MouseEvent("", null)
[object MouseEvent]{altKey: false, AT_TARGET: 2, bubbles: false, BUBBLING_PHASE: 3, button: 0, buttons: 0, cancelable (…)]

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Assigned To to “travil”

      Changed Assigned To from “travil” to “Travis L.”

      Changed Assigned To from “Travis L.” to “Arron E.”

      Changed Status to “Won’t fix”

    • Hello,

      Thank you for providing this information about the issue. We have confirmed the problem, and are considering a solution for a future build of Edge. We are presently tracking this issue as a duplicate of an existing internal bug report. We look forward to additional feedback you may have on how we can improve Microsoft Edge.

      Best Wishes,
      The MS Edge Team

    • A potential workaround is

      const ev = document.createEvent('DragEvent');
      ev.initEvent('dragstart', bubbles, cancelable);
      // or a fuller ev.initDragEvent(...) call
      

      Yep, I know it’s deprecated, but it does appear to work, and will hopefully only be
      removed once the real DragEvent constructor is fixed. The event can be dispatched and handled.

    You need to sign in to your Microsoft account to add a comment.

    Sign in