Skip to main content
peterc19015888
Known Participant
September 6, 2022
Question

SVG 'hidden' property is ignored

  • September 6, 2022
  • 1 reply
  • 355 views

Hello,

 

In this svg fragment the test should be hidden but when opening or placing the svg in Adobe Illustrator it is not.

Is this a known issue or expected behavior? In other SVG viewers I tried, the text is hidden.

All tips appreciated!

Tx

Peter

This topic has been closed for replies.

1 reply

Kevin Stohlmeyer
Community Expert
Community Expert
September 6, 2022

Where was the SVG originally built?

I would expect Illustrator to show all elements including "hiddent" attributes in order for you to edit properly.

peterc19015888
Known Participant
September 6, 2022

Hello

Tx @Kevin Stohlmeyer 
The SVG is a repro extracted from a problem we ran into while working on our Datylon Illustrator charting plugin 
Accoring to the SVG spec and other SVG renderes (tried a few browsers), the hidden property should work
Also in this sample, the circle is hidden when placing in AI, but the text is not. That does not seem very consistent.

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" visibility="hidden"/>
<g>
<text visibility="hidden" font-size="14" fill="rgb(255, 26, 26)" dy="100" dx="20">
<tspan>Some looong text</tspan>
</text>
</g>
</svg>

Best,

Peter