mirror of
https://gitee.com/antv/g6.git
synced 2024-12-04 12:49:04 +08:00
fix: show menu when triggered by click
This commit is contained in:
parent
935338fbf4
commit
3655ce723c
@ -157,7 +157,13 @@ export default class Menu extends Base {
|
||||
visibility: 'visible',
|
||||
});
|
||||
|
||||
// 左键单击会触发 body 上监听的 click 事件,导致菜单展示出来后又立即被隐藏了,需要过滤掉
|
||||
let triggeredByFirstClick = this.get('trigger') === 'click';
|
||||
const handler = (evt) => {
|
||||
if (triggeredByFirstClick) {
|
||||
triggeredByFirstClick = false;
|
||||
return;
|
||||
}
|
||||
self.onMenuHide();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user