danawoodman / react-fontawesome

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

Allow children to be placed inside the <FontAwesome> element #38

Closed j-f1 closed 7 years ago

j-f1 commented 7 years ago

They are placed after the ariaLabel if any.

danawoodman commented 7 years ago

@j-f1 why would you want to do this? This doesn't seem to be something standard with fontawesome..

danawoodman commented 7 years ago

Closing for now. @j-f1 let me know your rationale and we can re-open if it makes sense.

ryan-lane commented 6 years ago

@danawoodman See http://fontawesome.io/examples/#list

Right now it looks like this is impossible. The tag can be set to li, and the fa-li classname can be passed in, but no children can be passed in, and the inner tag contents are ignored.

danawoodman commented 6 years ago

@ryan-lane I think you're misunderstanding how FontAwesome works with lists. The <i> tag never has a child tag as you can see in the linked documentation you posted, like:

<ul class="fa-ul">
  <li><i class="fa-li fa fa-check-square"></i>List icons</li>
  <li><i class="fa-li fa fa-check-square"></i>can be used</li>
  <li><i class="fa-li fa fa-spinner fa-spin"></i>as bullets</li>
  <li><i class="fa-li fa fa-square"></i>in lists</li>
</ul>

Notice how the closing </i> is before the list text?

Hope that makes more sense 😄

ryan-lane commented 6 years ago

Ah. I see. Thanks for the info :)