mirror of https://gitee.com/antv-l7/antv-l7
fix(popup): popup react 自定事件不生效
This commit is contained in:
parent
19daa4d5c5
commit
64652bcae3
|
@ -214,13 +214,16 @@ export default class Popup extends EventEmitter implements IPopup {
|
|||
}
|
||||
|
||||
// 高德地图需要阻止事件冒泡 // 测试mapbox 地图不需要添加
|
||||
['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick'].forEach(
|
||||
(type) => {
|
||||
this.container.addEventListener(type, (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
},
|
||||
);
|
||||
const { stopPropagation} = this.popupOption;
|
||||
if(stopPropagation) {
|
||||
['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick'].forEach(
|
||||
(type) => {
|
||||
this.container.addEventListener(type, (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
if (maxWidth && this.container.style.maxWidth !== maxWidth) {
|
||||
this.container.style.maxWidth = maxWidth;
|
||||
|
|
Loading…
Reference in New Issue