javascript - Interrupt a drag&drop in progress
问题描述
I have an Angular7 application where I'm using native HTML Drag&Drop. When the dragged item enter in a specific area (catch with dragenter event), I want to force the interruption of the current drag operation.
But I could not find a way to do that in native JavaScript or Angular.
I put a dragenter
event on the div of this specific area and tried many solutions when it trigger :
preventDefault()
or stopPropagation()
don't work and I also tried to simulate a mouseup and a keyboard (escape press) events with a dispatchEvent : document.getElementById('interruptArea').dispatchEvent(AnEvent)
That's all I tried, didn't find anything else. Do you know if there are a way to do this ?
Thanks for your help !
解决方案
推荐阅读
- r - 使用 dpylr 从 R 中的复杂 txt 中选择特定字符串
- c# - 带有 Identity Server 重复表的 AspNet Identity
- python - anytree.exporter 的 JSON 编码不支持西里尔字母
- r - 正则表达式匹配与fuzzyjoin / dplyr
- r - R中的str_count - 检索字符串的总频率
- date - 使用“前一周的最后一天”过滤来自 BigQuery 的数据
- javascript - 如何模拟 loadable.lib 以使库在某些单元测试中同步加载?
- javascript - 循环函数查找 14 位数字并为这些结果运行脚本 - Javascript
- python - 有没有办法将这种类型的dict设置为redis?
- node.js - 如何计算猫鼬中其他子文档上的特定子文档?