fix: Cannot read property getModel of null problem on contextmenu when the target is not an item. closes: #1815.

This commit is contained in:
Yanyan-Wang 2020-07-21 19:09:42 +08:00 committed by Yanyan Wang
parent d620c58a0c
commit c0bbb07824
2 changed files with 13 additions and 12 deletions

View File

@ -6,7 +6,8 @@
- fix: combo edge with uncorrect end points; - fix: combo edge with uncorrect end points;
- fix: combo polyline edge with wrong path; - fix: combo polyline edge with wrong path;
- fix: getViewCenter with padding problem; - fix: getViewCenter with padding problem;
- feat: allow user to configure the initial positions for empty combos. - feat: allow user to configure the initial positions for empty combos;
- fix: Cannot read property 'getModel' of null problem on contextmenu when the target is not an item.
#### 3.5.10 #### 3.5.10
- fix: fitView and fitCenter with animate in the initial state; - fix: fitView and fitCenter with animate in the initial state;

View File

@ -94,8 +94,8 @@ export default class Menu extends Base {
const bbox = container.getBoundingClientRect(); const bbox = container.getBoundingClientRect();
let x = e.item.getModel().x; let x = e.item.getModel().x || e.x;
let y = e.item.getModel().y; let y = e.item.getModel().y || e.y;
// 若菜单超出画布范围,反向 // 若菜单超出画布范围,反向
if (x + bbox.width > width) { if (x + bbox.width > width) {