forked from mirror/BlueMap
Fix popups immideately closing again on mobile (Fixes #551)
This commit is contained in:
parent
4bb9c0a81d
commit
7ac9698b96
@ -58,7 +58,7 @@ export class PopupMarker extends Marker {
|
||||
|
||||
this.animation = null;
|
||||
|
||||
this.events.addEventListener('bluemapMapInteraction', this.onMapInteraction);
|
||||
this.events.addEventListener('bluemapMapInteraction', evt => window.setTimeout(() => this.onMapInteraction(evt)));
|
||||
|
||||
window.addEventListener("mousedown", this.removeHandler);
|
||||
window.addEventListener("touchstart", this.removeHandler, { passive: true });
|
||||
|
@ -139,10 +139,13 @@ export class LabelPopup extends CSS2DObject {
|
||||
window.removeEventListener("mousewheel", removeHandler);
|
||||
};
|
||||
|
||||
window.addEventListener("mousedown", removeHandler);
|
||||
window.addEventListener("touchstart", removeHandler, { passive: true });
|
||||
window.addEventListener("keydown", removeHandler);
|
||||
window.addEventListener("mousewheel", removeHandler);
|
||||
// add listeners delayed to prevent closing
|
||||
window.setTimeout(() => {
|
||||
window.addEventListener("mousedown", removeHandler);
|
||||
window.addEventListener("touchstart", removeHandler, { passive: true });
|
||||
window.addEventListener("keydown", removeHandler);
|
||||
window.addEventListener("mousewheel", removeHandler);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user