UITooltip doesn't work inside some VueComponents
See original GitHub issueI tried to add a <ui-tooltip> to a <ui-button> like so:
<ui-button ref="edit-btn">
Edit
<ui-tooltip trigger="edit-btn">
Select an element to edit
</ui-tooltip>
</ui-button>
And get an error:
Tooltip Error: You must provide a target for Tooltip to attach to
The problem is in UiTooltip.vue:
The initialize() method creates a new Tooltip object, passing this.$parent.$refs[this.trigger], as the target. However, the UiButton template wraps the content of the button in a div, so this.$parent is that wrapper div, and not the root element containing the ref value.
This is my workaround for now:
<div ref="edit-btn">
<ui-button>
Edit
</ui-button>
<ui-tooltip trigger="edit-btn">
Select an element to edit
</ui-tooltip>
</div>
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Vue v-on:click does not work on component - Stack Overflow
I'm trying to use the on click directive inside a component but it does not seem to work. When ...
Read more >Tailwind not working with vue · Discussion #1666 - GitHub
I was running into an issue with writing custom styles for inner elements of Vue Formulate so some of my styles were actually...
Read more >3 Anti-Patterns to avoid in Vue.js - Binarcode
So let's dive in and see what are some common mistakes that should be avoided when developing with Vue.js. Side effects inside computed...
Read more >Rendering a list of Vue components - Learn web development
Adding some data to render ... First we need to get an array of to-do items. To do that, we'll add a data...
Read more >Common mistakes to avoid while working with Vue.js
In this article, I'd like to share a few common issues that you may have to deal with when working with Vue.js. Some...
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

UiTooltip doesn’t work inside Ui-Tabs and v-for
Released in v1.1.0.