Long email address in tooltip breaking at the @

Hi All, have a column of email addresses that can get quite long so I stick a limit and add a tooltip for those cells where the limit is breached. I have a particular address that overflows the tooltip exactly at the @ symbol. If I change the @ to a - in the database the tooltip works fine
No description
No description
Solution:
a workaround ```php ->extraAttributes(fn (YorModel $record): array => [ 'x-tooltip' => "{content: '<div class="break-words">{$record->email}</div>', allowHTML:true}"...
Jump to solution
8 Replies
Solution
LeandroFerreira
LeandroFerreira2mo ago
a workaround
->extraAttributes(fn (YorModel $record): array => [
'x-tooltip' => "{content: '<div class=\"break-words\">{$record->email}</div>', allowHTML:true}"
])
->extraAttributes(fn (YorModel $record): array => [
'x-tooltip' => "{content: '<div class=\"break-words\">{$record->email}</div>', allowHTML:true}"
])
TheRealTeeHill
TheRealTeeHill2mo ago
👏 nice one work perfectly, do you know why the workaround is needed pls?
LeandroFerreira
LeandroFerreira2mo ago
tooltip method doesn't support html
TheRealTeeHill
TheRealTeeHill2mo ago
srs0=5h+goklf=na=natwest.com=laura.jankowski@reader.egress.com this is the offending string, what about it is breaking pls? maybe I should parse the email before storing to check if it is a wacky string like the one I posted 🙂
LeandroFerreira
LeandroFerreira2mo ago
yes, you should check the email before storing
TheRealTeeHill
TheRealTeeHill2mo ago
in this case it will be ok with the workaround as the email address will never be used by the system, its data from MS Exchange Online Protection quarantined emails, but good to know cheers ❤️
Hugo
Hugo5d ago
Hi, is this solution still working? I'm at the moment trying to use it to list data in a tooltip and it isn't showing any tooltip.
TheRealTeeHill
It’s still working fine in my implementation 🫡