2 Replies Latest reply on Sep 20, 2008 2:31 PM by nbelaevski

    Should text within a tich:toolTip wrap?

      I am using a very simple tooltip to display some text which is several lines long with no breaks. If I don't supply a width to the tooltip style the tooltip will size to full width of the text.

      If I do supply a width, the tooltip popup sizes to that width, but the text does not wrap and continues to draw outside of the ooltip area. I tried putting a container like rich:panel inside the tooltip with my text within that, and same problem occurs.

      Is there are way to fix the size of the tooltip width and have the contents auto-wrap?

      Regards,
      Mark

        • 1. Re: Should text within a tich:toolTip wrap?

          Ok,

          My bad - this is a browser-specific issue that was happening in Firefox but not IE.

          Here are the css styles to resolve this in other browsers (I have only tested that this works in IE and Firefox).

           white-space: pre-wrap; /* css-3 */
           word-wrap: break-word; /* IE 5.5+ */
           white-space: -moz-pre-wrap; /* Mozilla */
           white-space: -pre-wrap; /* Opera */
           white-space: -o-pre-wrap; /* Opera 7 */
          


          • 2. Re: Should text within a tich:toolTip wrap?
            nbelaevski

            That usually happens if you have words that itself are longer than tooltip width. Setting the proper width should resolve the issue.