Details
-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.11.1.0
-
Fix Version/s: None
-
Component/s: gui
-
Labels:None
-
Environment:Java and JavaScript
Description
Unfortunately, we can't mix word wrapping with <br> in JavaScript and get a proper precision height measurement. We were seeing an odd situation with the menu item tooltip on Select...Find. The observation was that the full top line was completely missing. Investigation showed that this was due to a failure in HTML5's element.getClientRect() -- the precision measurement mechanism that SwingJS uses. It seems to truncate the height substantially.
The original solution (Java, 2016) was to check each br-separated section for character length, and, if that is over 60 characters, to apply the pseudo style:
<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style>
(pseudo because that only works in Java; it isn't actually valid CSS with just the "350" there)>
The preliminary solution to date was to remove the word wrapping when the tooltip contains <br>, but that is not a finished idea.
The original solution (Java, 2016) was to check each br-separated section for character length, and, if that is over 60 characters, to apply the pseudo style:
<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style>
(pseudo because that only works in Java; it isn't actually valid CSS with just the "350" there)>
The preliminary solution to date was to remove the word wrapping when the tooltip contains <br>, but that is not a finished idea.