mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
preventDefault on sourceEvent, if present
This prevents a crash when d3_event is not the actual event, but is a transition event or similar
This commit is contained in:
@@ -223,8 +223,11 @@ export function uiSidebar(context) {
|
||||
|
||||
|
||||
sidebar.toggleCollapse = function(shouldCollapse) {
|
||||
if (d3_event) {
|
||||
d3_event.preventDefault();
|
||||
var e = d3_event;
|
||||
if (e.sourceEvent) {
|
||||
e.sourceEvent.preventDefault();
|
||||
} else if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
var container = d3_select('#id-container');
|
||||
|
||||
Reference in New Issue
Block a user