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

Popover directive - content as a method does not receive element as argument #4331



Copy link

d4mn commented Oct 31, 2019

Describe the bug

In documentation it says that a directive as a function should receive argument with reference to element: "A function reference to generate the content of the popover (receives one argument which is a reference to the DOM element triggering the popover)"
But none is received i got undefined

Steps to reproduce the bug

<b-img :key="index" v-b-popover.hover="zoomImage" v-bind="thumbProps" left :src="item" alt="Image 1"></b-img>

methods:{ zoomImage(el) { console.log(el); return '<img src="'+el.src+'">'; } }

Expected behavior

Should receive reference to get content from hovered element



  • BootstrapVue: 2.0.4
  • Bootstrap: 4.3.1
  • Vue: 2.6.10
Copy link

This might have been changed with the re-write of tooltips/popovers for version 2.0.0 (and the docs not correctly updated).

Also note, when returning the content as an HTML string, you need to set the .html modifier on the directive.

Copy link

d4mn commented Oct 31, 2019

Yes, i found another solution with events but for code sanity will use this fix as I intended:) Thanx!

tmorehouse added a commit that referenced this issue Oct 31, 2019
@tmorehouse tmorehouse changed the title Popover directive as a method does not receive argument Popover directive - content as a method does not receive element as argument Oct 31, 2019
Copy link

BootstrapVue v2.1.0 has been released, which has a fix for this issue.

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