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

Cannot use tooltip's option placement with function ??? #654

Closed
kytosai opened this issue Jul 23, 2018 · 6 comments
Closed

Cannot use tooltip's option placement with function ??? #654

kytosai opened this issue Jul 23, 2018 · 6 comments
Labels
docs No code, just documentation.

Comments

@kytosai
Copy link

kytosai commented Jul 23, 2018

I use webpack 4 with two package:
"popper.js": "^1.14.3"
"tooltip.js": "^1.2.0"

I have config tooltip with option:

new Tooltip(document.getElementById('ttip'),{
  html: true,
  placement: 'left',
  title () {
    return this.dataset.ttipTitle
  }
})

It work fine. But i try change placement with function

new Tooltip(document.getElementById('ttip'),{
  html: true,
  placement () {
    return 'left'
  },
  title () {
    return this.dataset.ttipTitle
  }
})

It have error

Uncaught TypeError: placement.indexOf is not a function

I don't know why. Please help me fix it !

Thank you !

@FezVrasta
Copy link
Member

Placement must be a string

@kytosai
Copy link
Author

kytosai commented Jul 23, 2018

Document: http://prntscr.com/k9r7ke
@FezVrasta ???

@FezVrasta
Copy link
Member

The documentation is wrong, I'm sorry. We need to update it.

@FezVrasta FezVrasta reopened this Jul 23, 2018
@FezVrasta FezVrasta added docs No code, just documentation. DIFFICULTY: low labels Jul 23, 2018
@kytosai
Copy link
Author

kytosai commented Jul 23, 2018

Thank you ! I like popper.js plugin

@piglovesyou
Copy link

@FezVrasta So all the PlacementFunction in the source code are supposed to be deleted? I'll take care of it.

piglovesyou added a commit to piglovesyou/popper.js that referenced this issue Jul 28, 2018
piglovesyou added a commit to piglovesyou/popper.js that referenced this issue Jul 28, 2018
piglovesyou added a commit to piglovesyou/popper.js that referenced this issue Jul 28, 2018
@piglovesyou
Copy link

It can be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs No code, just documentation.
Projects
None yet
Development

No branches or pull requests

3 participants