Títulos em SVG inseridos por um componente do tema são sobrescritos pelo título da página após a troca de aba

Acho que encontrei um bug no Discourse, mas é um pouco difícil mostrar uma reprodução, pois ele é acionado por um componente de tema que ainda não está oficialmente implantado em nenhum tema.

O componente de tema insere um SVG que funciona perfeitamente, mas, após alternar entre abas do navegador ou minimizar o navegador, todos os títulos no SVG são substituídos pelo título da página.

SVG antes da troca de aba:

<svg width="62pt" height="250.66666666666666" viewBox="0.00 0.00 62 188" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="translate(4,112) scale(1)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 58,-112 58,4 -4,4"></polygon>
<!-- a -->
<g id="node1" class="node">
<title>a</title>
<ellipse fill="none" stroke="black" cx="27" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-85.8" font-family="Times,serif" font-size="14.00">a</text>
</g>
<!-- b -->
<g id="node2" class="node">
<title>b</title>
<ellipse fill="none" stroke="black" cx="27" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-13.8" font-family="Times,serif" font-size="14.00">b</text>
</g>
<!-- a-&gt;b -->
<g id="edge1" class="edge">
<title>a-&gt;b</title>
<path fill="none" stroke="black" d="M27,-71.7C27,-63.98 27,-54.71 27,-46.11"></path>
<polygon fill="black" stroke="black" points="30.5,-46.1 27,-36.1 23.5,-46.1 30.5,-46.1"></polygon>
</g>
</g>
</svg>

SVG após a troca de aba:

<svg width="62pt" height="250.66666666666666" viewBox="0.00 0.00 62 188" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="translate(4,112) scale(1)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 58,-112 58,4 -4,4"></polygon>
<!-- a -->
<g id="node1" class="node">
<title>First test of the Mange theme - Discourse Development - Graphviz</title>
<ellipse fill="none" stroke="black" cx="27" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-85.8" font-family="Times,serif" font-size="14.00">a</text>
</g>
<!-- b -->
<g id="node2" class="node">
<title>First test of the Mange theme - Discourse Development - Graphviz</title>
<ellipse fill="none" stroke="black" cx="27" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-13.8" font-family="Times,serif" font-size="14.00">b</text>
</g>
<!-- a-&gt;b -->
<g id="edge1" class="edge">
<title>First test of the Mange theme - Discourse Development - Graphviz</title>
<path fill="none" stroke="black" d="M27,-71.7C27,-63.98 27,-54.71 27,-46.11"></path>
<polygon fill="black" stroke="black" points="30.5,-46.1 27,-36.1 23.5,-46.1 30.5,-46.1"></polygon>
</g>
</g>
</svg>

Ficarei feliz em reproduzir o bug em https://try.discourse.org/ ou em outro lugar, se alguém puder me dizer como posso instalar o componente de tema ou inserir o SVG diretamente para verificar se isso também aciona o bug.

3 curtidas

Obrigado, Magnus. Isso deve estar corrigido agora via FIX: Do not override all title elements with page title · discourse/discourse@5a3350c · GitHub

8 curtidas

Muito obrigado, @pmusaraj. Foi super rápido :smile:

Estou em um plano hospedado. Como/quando posso obter acesso à nova versão?

Está funcionando perfeitamente na minha instância agora. :heart:

Gostaria de marcar sua postagem como solução, mas não parece ser possível. Você não está usando o plugin Solved?

1 curtida

Nós usamos ‘resolvido’ aqui, mas não para a categoria de bugs.

2 curtidas

Este tópico foi automaticamente fechado após 3 dias. Novas respostas não são mais permitidas.