There seems to be an issue with aligning text in Adobe Illustrator when exporting graphics to SVG. When the text is initially exported, it is aligned to the center, but if you change the text using JavaScript from "Default text" to "New text", the alignment is lost.
I have tried adding "text-align:center" to the class or using the property "text-anchor:middle" on the text element, but these solutions did not work. Does anyone have any ideas on how to consistently align text to the center when changing its content?
Another interesting observation involves a specific SVG template where the text remains centered even with different content such as replacing "2013 Riesling" with a longer string of characters. Even after simplifying the template by removing unnecessary elements, the text still stays centered without any visible changes in the browser. This results in a significantly smaller SVG file size while maintaining text alignment. How is this possible?