Hello
The following SVG is not correctly rendered in the a plugin dialog. It seems svg text is not supported. In this case the ‘5000’ is not rendered while the grey rectangle is
Is this a known issue? Any workaround available?
Tx
Peter
const uxp = require("uxp");
async function showSvg(selection:any) {
document.body.innerHTML = `
<style>
dialog {
width: 400px;
height: 200px;
}
h1 {
display: flex;
align-items: center;
justify-content: space-between;
}
body { font: 12px Arial;}
</style>
<dialog>
<form method="dialog">
<h1><span>SVG test</span></h1>
<hr />
<label>
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="400" height="400">
<g width="400" height="400">
<rect x="0" y="10" height="20" width="200" fill="rgb(213, 213, 213)" style="fill-opacity: 1;"/>
</g>
<g transform="translate(100, 25)">
<text fill="rgb(0, 0, 0)" style="font-size: 16px;">5000</text>
</g>
</svg>
</label>
</form>
</dialog>
`;
const dialog = document.querySelector("dialog")
const result = await dialog.showModal();
return result;
}
export const commands = {
showSvg : showSvg
}