Jan366
(Jan Reinartz)
November 19, 2019, 12:18pm
1
Hi,
is it possible to write a tooltip with line break?
I tried something like that:
myELement.setAttribute("title", "line \n break");
or
myELement.setAttribute("title", "line 
 break");
In a basic Html file title="line 
 break"
works fine (in Chrome).
Jan
Kaspar4
(Kaspar Scherrer)
November 19, 2019, 12:24pm
2
Have you tried
?
→ [relevant SO post]
(https://stackoverflow.com/a/30388220/3441504 ), [Difference between ASCII Chr(10) and Chr(13)]
(https://www.petefreitag.com/item/863.cfm )
Jan366
(Jan Reinartz)
November 20, 2019, 9:20am
3
yes, unfortunately it does not work in Vaadin either.
When I inspect the item with chrome the title attribute is the same as in my test Html file … BUT it dont break the line in Vaadin.
Jan
Kaspar4
(Kaspar Scherrer)
November 20, 2019, 11:33am
4
Can you try both, to simulate a CRLF
? → line break
Also - found in [another related SO post]
(https://stackoverflow.com/a/17172412/3441504 ) - try using the style white-space: pre-line;
Or use <br>
tags, while setting the attribute data-html="true"
on myElement
. found [here]
(https://stackoverflow.com/a/40528252/3441504 )
Jan366
(Jan Reinartz)
November 20, 2019, 1:16pm
5
Thanks for your help so far but it does not work.
Jan