Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<title> should be stripped if there is none #333

Closed
inssein opened this issue Aug 16, 2019 · 2 comments · Fixed by #341
Closed

<title> should be stripped if there is none #333

inssein opened this issue Aug 16, 2019 · 2 comments · Fixed by #341

Comments

@inssein
Copy link

inssein commented Aug 16, 2019

🐛 Bug Report

When creating buttons for our application, we do something like:

<a title="Follow">
   <SvgIcon />
</a>

The above causes the output svg to contain a blank title (<title></title>), which in Chrome, stops the tooltip from showing up.

What if we completely stripped the title tag when it is undefined?

To Reproduce

Start a project with create-react-app, import an svg component and use it without a title attribute.

@gregberge
Copy link
Owner

Hello @inssein, yes we can completely strip the tag if it causes some unexpected bug like yours. Could you submit a PR to strip it if not needed?

@sudkumar
Copy link
Contributor

@inssein , @neoziro I have created a PR. Please have a look.

gregberge pushed a commit that referenced this issue Sep 24, 2019
Currently when no title is passed and titleProp is set to `true`, we are
rendering an empty title element which is causing some issues. So we
have added a conditional statement for rendering the title element only
if the title props is not falsy. If we have an existing title, that will
rendered by default. Passing the `null` values as the title will cause
also cause the title element for not render even if a default title
exists on the svg

Fixes #333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants