Skip to content

Commit

Permalink
Fix regression about popup close button modifying the URL (Leaflet#8160)
Browse files Browse the repository at this point in the history
IvanSanchez authored Apr 19, 2022
1 parent 2a60e29 commit 2da373f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layer/Popup.js
Original file line number Diff line number Diff line change
@@ -203,7 +203,10 @@ export var Popup = DivOverlay.extend({
closeButton.href = '#close';
closeButton.innerHTML = '<span aria-hidden="true">&#215;</span>';

DomEvent.on(closeButton, 'click', this.close, this);
DomEvent.on(closeButton, 'click', function (ev) {
DomEvent.preventDefault(ev);
this.close();
}, this);
}
},

0 comments on commit 2da373f

Please sign in to comment.