File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5272,8 +5272,16 @@ function RemoteFunctions(config = {}) {
52725272 editIsSpecialTag = false ;
52735273 }
52745274 }
5275+
52755276 if ( ! editIsSpecialTag ) {
5276- childElement = self . htmlDocument . createElement ( edit . tag ) ;
5277+ // If the parent element is an instance of SVGElement or we're inserting an <svg> tag directly,
5278+ // we need to create it in the SVG namespace otherwise SVG elements won't render
5279+ // correctly in live preview until it's reloaded
5280+ if ( targetElement instanceof SVGElement || edit . tag . toLowerCase ( ) === "svg" ) {
5281+ childElement = self . htmlDocument . createElementNS ( "http://www.w3.org/2000/svg" , edit . tag ) ;
5282+ } else {
5283+ childElement = self . htmlDocument . createElement ( edit . tag ) ;
5284+ }
52775285 }
52785286
52795287 Object . keys ( edit . attributes ) . forEach ( function ( attr ) {
You can’t perform that action at this time.
0 commit comments