Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: HTML Tooltips don't work with data-tooltip-id #440

Closed
3 tasks done
Razzmatazzz opened this issue Dec 7, 2023 · 1 comment
Closed
3 tasks done

[Bug]: HTML Tooltips don't work with data-tooltip-id #440

Razzmatazzz opened this issue Dec 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Razzmatazzz
Copy link

Before submitting...

Context

I've been trying to convert a project from materializecss 1.0 to 2.0, but it doesn't seem like html tooltips are working. This may be because I am dynamically generating both the tooltip trigger and content elements, but I'm still calling M.Tooltip.init on the tooltip triggers after generating the new elements (and have confirmed that the elements exists at the time that method is invoked).

Current Behavior

It appears that using the data-tooltip-id attribute on tooltip triggers does not actually allow for HTML in tooltips. The tooltips appear, but they are empty.

Expected behavior

The html from the specified content elements should display.

Possible Solutions or Causes

I don't really know exactly what would be causing it, but I did see that the docs are somewhat out of date related to the removal of the unsafeHTML option. I'm not using that option, but it seems possible that removal of that option also did something to break the data-tooltip-id method of html in tooltips.

Steps to reproduce

I copy and pasted the example code from the docs into this jsfiddle, and it shows the same issue:
https://jsfiddle.net/0fo31d25/

Your Environment

  • Version used: 2.0.3-alpha
  • Browser Name and version: Firefox 119.0.1
  • Operating System and version (desktop or mobile): Windows 11
@Razzmatazzz Razzmatazzz added the bug Something isn't working label Dec 7, 2023
@Razzmatazzz Razzmatazzz changed the title [Bug]: [Bug]: HTML Tooltips don't work with data-tooltip-id Dec 7, 2023
@Razzmatazzz
Copy link
Author

Nevermind, manually switching to version 2.0.3-beta resolved the issue. Thanks for keeping this library updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant