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.

Multiple HTML instances vs one

See original GitHub issue

Hi there,

First off thanks for a lovely tooltip library! The docs are extensive, the tooltip itself is more-than-plenty configurable and it’s been a breeze to use so far!

Not sure if this is a bug report or simply me misusing tippy, but I’m trying to add an interactive options menu to every item on a list with Vue. Since an html template via direct ref is only usable once, I’ve set up my loop so that every list item’s options menu also renders its own tooltip contents. Then, in the component’s mounted hook, I’m looping through the generated menus and initialising tippy on each:

mounted () {
  const tooltips = document.querySelectorAll('.filter-tippy')

  ;[].forEach.call(tooltips, tooltip => {
    if (tooltip._tippy) return
    tippy(tooltip, {
      html: tooltip.querySelector('[data-template]'),
      appendTo: tooltip.parentNode,
      animateFill: false,
      performance: true,
      placement: 'bottom'
    })
  })
}

Current behaviour: screen shot 2018-09-19 at 10 48 40

I also found https://github.com/atomiks/tippyjs/issues/10 and the mention of multiple, but that doesn’t seem to work for me so i’m wondering if it’s the case of creating multiple instances of tippy?

When I tried to replicate this behaviour in your Codepen template, then it works as expected (an active tippy is closed before opening a new one). The bug shouldn’t be anything vue-specific since I’m initiating tippy with vanilla JS. Any other information I could provide to further debug this?

Replication: https://codepen.io/ajv/pen/OoaWLB

How should I approach this situation? I thought of also having a single instance, but then I couldn’t pass the item’s data object to the listener and would have to read certain attributes from the event target’s data attributes, I presume.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
atomikscommented, Sep 20, 2018

Okay I think I found the issue:

You’re using @click.stop which stops the click event from propagating up the DOM tree to the document. The document has a global click listener which handles hiding all tooltips on the document that are visible. So, either you can use the hack posted above, or remove @click.stop and replace it with something else.

1reaction
atomikscommented, May 7, 2019

Yeah, Methods only lists tippy instance methods, but static methods should be listed too

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use one single Prototype-Instance throughout multiple ...
Keep everything on a single page. Single page apps are very popular. Load what you need to load asynchronously and you will still...
Read more >
Managing multiple Postfix instances on a single host
Multiple instances give you the freedom to tune each Postfix instance to a single task that it does well and to combine instances...
Read more >
Running Multiple Server Instances - Hangfire Documentation
It is possible to run multiple server instances inside a process, machine, or on several machines at the same time. Each server use...
Read more >
Windows: Running multiple server instances on a single system
You can create more than one server instance on your system. Each server instance has its own instance directory, and database and log...
Read more >
Understanding Running Multiple Instances of JD Edwards ...
Be prepared to manually copy data and to set up new Object Configuration Manager (OCM) mappings for each new instance. A JD Edwards...
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