floating-vue icon indicating copy to clipboard operation
floating-vue copied to clipboard

Default placement not working

Open adamreisnz opened this issue 5 years ago • 3 comments

I have the following config:

import VueTooltip from 'v-tooltip'
Vue.use(VueTooltip, {
  defaultPlacement: 'bottom',
  defaultClass: '',
  defaultTemplate: `
    <div class="Tooltip" role="tooltip">
    <div class="Tooltip-arrow"></div>
    <div class="Tooltip-body"></div>
    </div>
  `,
  defaultArrowSelector: '.Tooltip-arrow',
  defaultInnerSelector: '.Tooltip-body',
  defaultTargetClass: 'has-tooltip',
  defaultLoadingClass: 'is-loading',
  defaultLoadingContent: '<spinner/>',
});

And HTML:

<i class="Icon" v-if="isFoo" v-tooltip="'My tooltip'">warning</i>

This fails to produce a tooltip.

I have to explicitly specify the placement in order for it to work:

<i class="Icon" v-if="isFoo" v-tooltip.bottom="'My tooltip'">warning</i>

Am I doing something wrong or is this a bug? I would expect that it would honour the configured default placement if I don't specify it.

adamreisnz avatar Jan 07 '20 06:01 adamreisnz

Please provide a runnable minimal reproduction, thanks! :pray:

Akryum avatar Dec 30 '20 21:12 Akryum

Hi @adamreisnz Did you find a workaround ? In my case, even the v-tooltip.bottom = solution doesn't work. x-placement is always equal to "top"

ram-you avatar Jun 28 '21 08:06 ram-you

No I did not. I provided a reproduction up in my original post.

adamreisnz avatar Jun 28 '21 21:06 adamreisnz