How do you get the selected items from a dragstart event in Chrome? Is dataTransfer.getData broken?

前端 未结 2 468
你的背包
你的背包 2021-01-15 11:52

I am part of a team that works on a Java application that, among other things, helps people organize and annotate information from the web. We currently use a Firefox plug-

相关标签:
2条回答
  • 2021-01-15 11:55

    Paste this line before the error line:

    event.dataTransfer = event.originalEvent.dataTransfer;
    

    This worked for me.

    0 讨论(0)
  • 2021-01-15 12:13

    WebKit, and hence Chrome, is quite restrictive on when you can call getData. You're not allowed to do it inside dragstart or dragover. I think this is the canonical bug.

    0 讨论(0)
提交回复
热议问题