Hi,
I would really appreciate if you could add html content on tooltip, at least for
.
I use tooltips for forms online help and a one line tooltip is not enough.
My easy fix is to replace .text with .html on line 1195 and 1222 of materalize.js but that would be better to implement this optionnaly with something like :
data-enable-html="true"
Thanks,
would be great!, recently I needed to add a line break or an icon but got to resign and used plaintext :(
:+1:
:+1: this would be very helpful
![]()
We need this!
Jup waiting for this aswell
Hi, as said in #2064
You just have to change the line 59 into the tooltip.js file :
newTooltip.children('span').text(origin.attr('data-tooltip'));
As :
newTooltip.children('span').html(origin.attr('data-tooltip'));
And it should works.
Really need this. I have two issues, 1) i need html in tooltips and 2) if you have a lot of text in the tooltip, you need to be able to control its width.
:+1:
As I don't want to modify the materialize JS file, I use this code
$(document).ready(function() {
$('.tooltipped').each(function(index, element) {
var span = $('#' + $(element).attr('data-tooltip-id') + '>span:first-child');
span.before($(element).attr('data-tooltip'));
span.remove();
});
});
Most helpful comment
As I don't want to modify the materialize JS file, I use this code