45
Views
3
Comments
Solved
Increase width of tooltip makes it cut off at edge of screen
Question
Application Type
Reactive
Platform Version
11.32.0 (Build 44177)

I would like to make my tooltips in my application wider, with a max-width of 500px instead of 250px.

I've used the following CSS to make this happen:

.osui-tooltip .osui-balloon {    max-width: 500px; }


This does make the tooltip wider, however, if the tooltip is near the edge of the window, it no longer automatically moves the tooltip. Instead, it just cuts off the text at the edge of the window. See the example image below.

We've just recently done a platform upgrade to 11.32.0, and this problem didn't happen in the older version.

I'm hoping someone can provide some CSS classes or some other solution to increase the width of my tooltips.

Thanks in advance,

Gaius

2026-02-16 05-51-10
Sahana K
Solution

Hi Gaius Augustus ,

1.Ensure that the tooltip text wraps properly inside the container 
       .osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal; 

    word-wrap: break-word

}
2.Make Adjust  tooltip dynamically
   

.osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal;

    word-wrap: break-word;

    position: absolute !important;

    left: auto !important;

    right: auto !important;

}

3.tooltip container itself is being cut off ,It need to position dynamically,
     

.osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal;

    word-wrap: break-word;

    overflow: visible !important;

    transform: translate(-50%);

}

4.If the tooltip exceed the screen width ,Use this css

     

.osui-tooltip .osui-balloon {

    max-width: min(500px, calc(100vw - 20px));

}

2nd method-Or else you can try using JavaScript

document.querySelectorAll('.osui-tooltip .osui-balloon').forEach(tooltip => {

    tooltip.addEventListener('mouseover', function () {

        let rect = this.getBoundingClientRect();

        if (rect.right > window.innerWidth) {

            this.style.left = `${window.innerWidth - rect.width - 10}px`;

        }

    });

});

Thanks,
Sahana


2026-01-28 16-57-48
Mihai Melencu
Champion

Hey @Gaius Augustus ,

You can adjust the tooltip margins to ensure it fits within the screen. I implemented this dynamically using JavaScript, but you can also achieve it statically with CSS. Below is the JavaScript code I used:  Adjust tooltip.

This is the result:


2026-02-16 05-51-10
Sahana K
Solution

Hi Gaius Augustus ,

1.Ensure that the tooltip text wraps properly inside the container 
       .osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal; 

    word-wrap: break-word

}
2.Make Adjust  tooltip dynamically
   

.osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal;

    word-wrap: break-word;

    position: absolute !important;

    left: auto !important;

    right: auto !important;

}

3.tooltip container itself is being cut off ,It need to position dynamically,
     

.osui-tooltip .osui-balloon {

    max-width: 500px;

    white-space: normal;

    word-wrap: break-word;

    overflow: visible !important;

    transform: translate(-50%);

}

4.If the tooltip exceed the screen width ,Use this css

     

.osui-tooltip .osui-balloon {

    max-width: min(500px, calc(100vw - 20px));

}

2nd method-Or else you can try using JavaScript

document.querySelectorAll('.osui-tooltip .osui-balloon').forEach(tooltip => {

    tooltip.addEventListener('mouseover', function () {

        let rect = this.getBoundingClientRect();

        if (rect.right > window.innerWidth) {

            this.style.left = `${window.innerWidth - rect.width - 10}px`;

        }

    });

});

Thanks,
Sahana


2023-11-22 10-51-50
Jozy Sohail

Hi Gaius,

Just apply 

  1. position: fixed;
  2.     left: 20px;
  3. in .osui-tooltip .osui-balloon {  

like this

before

after

also you can try changing its position

hope it helps.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.