diff --git a/src/core/creation.ts b/src/core/creation.ts index f35836c8..d24fbbe3 100644 --- a/src/core/creation.ts +++ b/src/core/creation.ts @@ -38,15 +38,15 @@ export function createSvg( .forEach(svg => container.removeChild(svg)); // Create svg object with width and height or use 100% as default - const svg = new Svg('svg') - .attr({ - width, - height - }) - .attr({ - // TODO: Check better solution (browser support) and remove inline styles due to CSP - style: `width: ${width}; height: ${height};` - }); + const svg = new Svg('svg').attr({ + width, + height + }); + + // TODO: Check better solution (browser support) + const svgNode = svg.getNode(); + svgNode.style.width = width; + svgNode.style.height = height; if (className) { svg.addClass(className); @@ -261,9 +261,9 @@ export function createLabel( content.textContent = String(label); const labelElement = group.foreignObject(content, { - style: 'overflow: visible;', ...positionalData }); + (labelElement.getNode()).style.overflow = 'visible'; eventEmitter.emit('draw', { type: 'label',