Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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