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

Closed
d4mn opened this issue Oct 31, 2019 · 3 comments · Fixed by #4332, mariazevedo88/hash-generator-js#17 or CloudsdaleGroup/AnimFM#3

Comments

@d4mn
Copy link

@d4mn 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

Versions

Libraries:

  • BootstrapVue: 2.0.4
  • Bootstrap: 4.3.1
  • Vue: 2.6.10
@tmorehouse

This comment has been minimized.

Copy link
Member

@tmorehouse tmorehouse commented Oct 31, 2019

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.

tmorehouse added a commit that referenced this issue Oct 31, 2019
… passed to title/content function (fixes #4331)
@d4mn

This comment has been minimized.

Copy link
Author

@d4mn 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
… passed to title/content function (fixes #4331) (#4332)
@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
@tmorehouse

This comment has been minimized.

Copy link
Member

@tmorehouse tmorehouse commented Nov 13, 2019

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
Projects
None yet
3 participants
You can’t perform that action at this time.