Adding a foreignObject to a svg element hides the handle of a resizable element.
The follwoing snippet displays correctly
<div style="height: 200px; width: 200px; resize: vertical; overflow: auto; background-color: #dfd">
<svg viewbox = "10 10 50 50" height="100" style="background-color: #fdd">
<!-- <foreignObject x="20" y="40" width="10" height="10" style="background-color: #adf;"></foreignObject> -->
</svg>
</div>
while the snippet below has no resize handle displayed.
<div style="height: 200px; width: 200px; resize: vertical; overflow: auto; background-color: #dfd">
<svg viewbox = "10 10 50 50" height="100" style="background-color: #fdd">
<foreignObject x="20" y="40" width="10" height="10" style="background-color: #adf;"></foreignObject>
</svg>
</div>
The handle is still functional and will display as soon as scrollbars appear. Am I missing something?
2
Answers
I found out that adding an empty div with relative positioning makes the handle appear:
That looks like a bug in Chrome. Firefox works fine. In any case you should stick to the requirements for
<foreignObject>
and add namespace to the child element.