antvis/G6

右键的mouseup事件没有被触发 #1671

xinheHuang posted onGitHub

根据浏览器和jquery实现规范,在contextmenu事件调用preventDefault方法时,右键的mouseup事件应该被触发。 原因可能是g-base中的这段代码,直接忽视了右键:https://github.com/antvis/g/blob/f1dd2cc436ea123939f400a9a9d88f1ebce46be9/packages/g-base/src/event/event-contoller.ts#L319-L340

jquery 的实现: 打开链接: https://www.runoob.com/try/try.php?filename=tryjquery_event_bind_ref 并粘贴以下代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>contextmenu test case</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("p").bind("click",function(){
    console.log("click");
  });
  $("p").bind("mousedown",function(){
    console.log("mousedown");
  });
  $("p").bind("mouseup",function(){
    console.log("mouseup");
  });
  $("p").bind("contextmenu",function(ev){
     ev.preventDefault();
    console.log("contextmenu");

  });
});
</script>
</head>
<body>
<p>点我!</p>
</body>
</html>

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help. 这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests