Component overwrites sibling text unless wrapped in containing element
See original GitHub issueWhen 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:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
It seems to be related to the usage of the self-closing tags: https://codesandbox.io/s/pwj7zl7340