Skip to content

Commit

Permalink
feat: avoid race condition, resize map once target size ok (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas authored Dec 8, 2023
1 parent 3455805 commit 38c57c0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@
var prop = attrs[attr];

var map = scope.$eval(prop);
map.setTarget(element[0]);
var target = element[0];

var resizeObserver = new ResizeObserver(function() {
map.updateSize();
resizeObserver.unobserve(target);
});

map.setTarget(target);
resizeObserver.observe(target);
}
};
};
Expand Down

0 comments on commit 38c57c0

Please sign in to comment.