Popper-core: Cannot use tooltip's option placement with function ???

Created on 23 Jul 2018  路  6Comments  路  Source: popperjs/popper-core

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 !

low docs

All 6 comments

Placement must be a string

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

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

Thank you ! I like popper.js plugin

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

It can be fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nainardev picture nainardev  路  3Comments

cixonline picture cixonline  路  5Comments

Madhu94 picture Madhu94  路  3Comments

FezVrasta picture FezVrasta  路  3Comments

memboc picture memboc  路  3Comments