1

Bootstrap 3 used to provide functionality to support data-placement="left auto" where it would show the tip on the left if there was enough room, otherwise it would calculate an auto placement.

Bootstrap 4 does not support two placement values, you can only provide left OR auto.

Any idea on how to achieve this in BS4? I was working off this comment along with looking at BS3.js source, but I am getting stuck trying to determine the 'current height/width' of the tooltip to be displayed and from BS3.js, what to use as the 'viewport' (I'm assuming the window object?)

isherwood
  • 58,414
  • 16
  • 114
  • 157
Terry
  • 2,148
  • 2
  • 32
  • 53
  • You may take a look to this [fiddle](https://jsfiddle.net/y2sqc109/3/), – gaetanoM Feb 01 '19 at 20:43
  • The `fallbackPlacement` option from [the docs](https://getbootstrap.com/docs/4.2/components/tooltips/#options) clearly isn't working. https://jsfiddle.net/isherwood/8wmsgxek/ – isherwood Feb 01 '19 at 21:38

1 Answers1

0

Hmm...even thought Bootstrap 4/popper doesn't support the 'dual' placement values that Bootstrap 3 did, it seems to work as thought 'auto' was appended. i.e. if your placement is only 'left' but there isn't room, BS4/popper already moves it to make sure it displays. So I guess this is a non-issue. Surprised they even support an 'auto' placement. Seems like developers should always provide their 'desired' location and let popper 'fix' it if the viewport doesn't support it :)

Terry
  • 2,148
  • 2
  • 32
  • 53