question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Component overwrites sibling text unless wrapped in containing element

See original GitHub issue

When using the vue icon component in an element with sibling text, it is removing the text on render:

Old method using the JS library (works with icon and sibling text visible):

<div>
    <i class="fas fa-bolt"></i> Some sibling text
</div>

New method using Vue component (not working with ONLY icon visible… the sibling text is removed from the dom):

<div>
    <font-awesome-icon icon="bolt" /> Some sibling text
</div>

If I wrap the component in a span, it works as intended:

<div>
    <span><font-awesome-icon icon="bolt" /></span> Some sibling text
</div>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
OriginalEXEcommented, Jan 26, 2018

Ok I figured it out. You can’t use self closing tags for your Vue components when you use in-line templates. You can only do it when using .vue single file components.

0reactions
OriginalEXEcommented, Jan 26, 2018

It seems to be related to the usage of the self-closing tags: https://codesandbox.io/s/pwj7zl7340

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >
Make text wrap when it meets sibling span - Stack Overflow
What I am trying to achieve is - while resizing the window, make the left span line break when it meets the right...
Read more >
How To Use Relationships to Select HTML Elements with CSS
In CSS, it is possible to select an element based on its relationship or proximity to ... Begin by opening index.html in your...
Read more >
Understanding flex-grow, flex-shrink, and flex-basis - CSS-Tricks
When you apply a CSS property to an element, there's lots of things ... Now all of this changes if we set flex-wrap...
Read more >
jQuery API Documentation
If you're new to jQuery, we recommend that you check out the jQuery ... Create a new jQuery object with elements added to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found