From 35c4b6ab87000007e9aea8f2f3651e75831bfb25 Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Mon, 16 May 2022 13:13:09 +0200 Subject: [PATCH] Fix trailer not hidden on segment hover --- js/plugin/Routing.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/plugin/Routing.js b/js/plugin/Routing.js index ed6bbb8..f286cee 100644 --- a/js/plugin/Routing.js +++ b/js/plugin/Routing.js @@ -188,12 +188,15 @@ BR.Routing = L.Routing.extend({ this._draw.on('enabled', function () { this._map.on('mouseout', hide, this); this._map.on('mouseover', show, this); + // prevent showing trailer on segment hover because of bubbling to map with canvas, calling show above + this._parent._segments.on('mouseover', L.DomEvent.stopPropagation, this); L.DomEvent.on(this._map._controlContainer, 'mouseout', show, this); L.DomEvent.on(this._map._controlContainer, 'mouseover', hideOverControl, this); }); this._draw.on('disabled', function () { this._map.off('mouseout', hide, this); this._map.off('mouseover', show, this); + this._parent._segments.off('mouseover', L.DomEvent.stopPropagation, this); L.DomEvent.off(this._map._controlContainer, 'mouseout', show, this); L.DomEvent.off(this._map._controlContainer, 'mouseover', hideOverControl, this); });