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.

UITooltip doesn't work inside some VueComponents

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lavezzi1commented, Apr 27, 2017

UiTooltip doesn’t work inside Ui-Tabs and v-for

0reactions
JosephusPayecommented, Jan 28, 2019

Released in v1.1.0.

Read more comments on GitHub >

github_iconTop 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 >

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