Skip to content

Commit

Permalink
Fix some CSP violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrampon committed Aug 27, 2024
1 parent 1067900 commit 1b50e1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <HTMLElement>svg.getNode();
svgNode.style.width = <string>width;
svgNode.style.height = <string>height;

if (className) {
svg.addClass(className);
Expand Down Expand Up @@ -261,9 +261,9 @@ export function createLabel(
content.textContent = String(label);

const labelElement = group.foreignObject(content, {
style: 'overflow: visible;',
...positionalData
});
(<HTMLElement>labelElement.getNode()).style.overflow = 'visible';

eventEmitter.emit<LabelDrawEvent>('draw', {
type: 'label',
Expand Down

0 comments on commit 1b50e1e

Please sign in to comment.