Fix #7439 for mousemove (#7809)

We need pass event to map when canvas does not have targets
This commit is contained in:
johnd0e
2021-11-26 13:07:16 +02:00
committed by GitHub
parent 18389fbe70
commit 38c0c55ff0
2 changed files with 8 additions and 3 deletions

View File

@ -94,6 +94,13 @@ describe('Canvas', function () {
expect(spyCircle.callCount).to.eql(1);
});
it("should not block mousemove event going to non-canvas features", function () {
var spyMap = sinon.spy();
map.on("mousemove", spyMap);
happen.at('mousemove', 151, 151); // empty space
expect(spyMap.calledOnce).to.be.ok();
});
it("should fire preclick before click", function () {
var clickSpy = sinon.spy();
var preclickSpy = sinon.spy();

View File

@ -410,9 +410,7 @@ export var Canvas = Renderer.extend({
}
}
if (this._hoveredLayer) {
this._fireEvent([this._hoveredLayer], e);
}
this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e);
this._mouseHoverThrottled = true;
setTimeout(Util.bind(function () {