Tooltip negative positions. #801

Blueowner opened this Issue Aug 11, 2016 · 0 comments


None yet

1 participant


I'm new to the library and I've found out that in certain situations the tooltips go outside of the viewport, even with position: { viewport: $(window) }. I'm not sure why this happens.
I had to push an hotfix and solved it by making sure position.left was always positive (just above line 890:

if (position.left < 0) {
  position.left = 0;

My question is, would it make sense to allow to pass a boolean or a callback function to forbid negative values?

position: {
  // As a boolean
  withNegative: false,
  // or callback
  onReposition: function(position) {
    if (position.left < 0) { position.left = 0; }
    return position;

I've only tested always-positive positions with viewport: $(window).

Is there any downside with always-positive position.left if the target's container is window or document?

I've made a JSFiddle to show the issue:

screen shot 2016-08-11 at 14 11 39

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