danawoodman / react-fontawesome

A React Font Awesome component.
https://www.npmjs.com/package/react-fontawesome
MIT License
668 stars 72 forks source link

Title not appearing in Chrome #70

Closed camloken closed 6 years ago

camloken commented 6 years ago

Sometimes it's helpful to put title's on icons to provide helpful tips on hover. I just realized react-fontawesome doesn't support the title attribute.

danawoodman commented 6 years ago

Actually, it does since we just pass any unknown props to the component. Give it a shot and if it doesn't work, reopen!

camloken commented 6 years ago

Actually, the title attribute is not supported on SVG elements in Chrome. You're right, the title attribute is rendered in the DOM, but chrome doesn't do anything with it, so you can't see it. The proper way to do it (if someone feels so inclined) is to inject a <title> element inside the <svg> tag.

danawoodman commented 6 years ago

I’m confused. You’re mentioning SVG but this library doesn’t support the new FA SVG icons. Are you sure you’re not confusing this library with the official FA React Component?

camloken commented 6 years ago

My apologies, I was confused this with the fortawesome/react-fontawesome repo.

danawoodman commented 6 years ago

Haha, no worries, that's what I thought 😉

Have a good weekend 🕺