We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 295aa25 commit aace789Copy full SHA for aace789
src/plugins/envelope.ts
@@ -259,8 +259,14 @@ class Polyline extends EventEmitter<{
259
260
update() {
261
const { svg } = this
262
- const aspectRatioX = svg.viewBox.baseVal.width / svg.clientWidth
263
- const aspectRatioY = svg.viewBox.baseVal.height / svg.clientHeight
+ // Skip the update if the container is hidden
+ const { clientWidth, clientHeight } = svg
264
+ if (!clientWidth || !clientHeight) {
265
+ return
266
+ }
267
+
268
+ const aspectRatioX = svg.viewBox.baseVal.width / clientWidth
269
+ const aspectRatioY = svg.viewBox.baseVal.height / clientHeight
270
const circles = svg.querySelectorAll('ellipse')
271
272
circles.forEach((circle) => {
0 commit comments