Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instances of VTooltip render in random places #980

Open
thomas-wtfoxtrot opened this issue Aug 14, 2023 · 2 comments
Open

Multiple instances of VTooltip render in random places #980

thomas-wtfoxtrot opened this issue Aug 14, 2023 · 2 comments

Comments

@thomas-wtfoxtrot
Copy link

We are using floating vues VTooltip to anchor decorative elements to a headline.

I just realized, that in some constellations (I could not make out a pattern yet) there are 3 instances of the Tooltip rendered in the DOM and also visible in the browser (right on top of the page, so visually distracting).

I'll attach the code, that is used inside our Nuxt 2 application.

Floating-Vue Version: ^1.0.0-beta.19

usage inside a component

        <VTooltip
          theme="img"
          :triggers="[]"
          :shown="true"
        >
          <span v-html="page.title"></span>
          <template #popper>
            <img
              :src="page.headerImg.src"
              :alt="page.headerImg.alt"
              loading="lazy"
            />
          </template>
        </VTooltip>

plugins/floating-vue.js

import Vue from 'vue'
import FloatingVue from 'floating-vue'

Vue.use(FloatingVue, {
  themes: {
    img: {
      $resetCss: true,
      triggers: ['click', 'hover', 'focus'],
      autoHide: false,
      placement: 'bottom-end',
      distance: -200,
      preventOverflow: true,
      skidding: 100,
      instantMove: true,
      handleResize: false,
      flip: false,
      shift: true,
      shiftCrossAxis: false
    }
  }
})

The rendered DOM elements

<div id="popper_ux9ywadk_ai9lm6" aria-hidden="false" data-popper-placement="bottom" class="v-popper__popper v-popper--theme-img v-popper__popper--shown v-popper__popper--show-to" style="position: absolute; transform: translate3d(0px, -200px, 0px);"><div class="v-popper__backdrop"></div><div class="v-popper__wrapper"><div class="v-popper__inner"><div><img src="/img/company/brain.gif" loading="lazy" class="wide-image md:max-w-300"></div><!----></div><div class="v-popper__arrow-container" style="left: 0px;"><div class="v-popper__arrow-outer"></div><div class="v-popper__arrow-inner"></div></div></div></div>
<div id="popper_63v2xr6y_ai9lm7" aria-hidden="false" data-popper-placement="bottom" class="v-popper__popper v-popper--theme-img v-popper__popper--shown v-popper__popper--show-to" style="position: absolute; transform: translate3d(0px, -200px, 0px);"><div class="v-popper__backdrop"></div><div class="v-popper__wrapper"><div class="v-popper__inner"><div><img src="/img/company/brain.gif" loading="lazy" class="wide-image md:max-w-300"></div><!----></div><div class="v-popper__arrow-container" style="left: 0px;"><div class="v-popper__arrow-outer"></div><div class="v-popper__arrow-inner"></div></div></div></div>
<!-- The following one is the only, that actually should be rendered -->
<div id="popper_gppsg8e0_ai9lmm" aria-hidden="false" data-popper-placement="bottom" class="v-popper__popper v-popper--theme-img v-popper__popper--shown v-popper__popper--show-to" style="position: absolute; transform: translate3d(127px, 168px, 0px);"><div class="v-popper__backdrop"></div><div class="v-popper__wrapper"><div class="v-popper__inner"><div><img src="/img/company/brain.gif" loading="lazy" class="wide-image md:max-w-300"></div><!----></div><div class="v-popper__arrow-container" style="left: 63.2953px;"><div class="v-popper__arrow-outer"></div><div class="v-popper__arrow-inner"></div></div></div></div>
</body>
@Akryum
Copy link
Owner

Akryum commented Aug 14, 2023

Could you create a small runnable reproduction (for example with stackblitz) showing the problematic behavior? Thanks!

@thomas-wtfoxtrot
Copy link
Author

I will try to make time for this ASAP 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants