alpine-tooltip icon indicating copy to clipboard operation
alpine-tooltip copied to clipboard

The tooltip does not appear

Open HosMercury opened this issue 2 years ago • 8 comments

     <button class="border inline text-black p-1 bg-white rounded m-1"
      x-text="product.number" x-tooltip="product.name"></button>

I have added the script and the CSS but the tooltip not show , Even the raw tooltip does not show .. nothing works

      <link rel="stylesheet" href="//unpkg.com/tippy.js@6/dist/tippy.css" />
    <script src="//cdn.jsdelivr.net/npm/@ryangjchandler/[email protected]/dist/cdn.min.js" defer></script>

HosMercury avatar Dec 25 '22 22:12 HosMercury

@HosMercury You'll need to provide more information. Do you get any console errors?

ryangjchandler avatar Dec 25 '22 23:12 ryangjchandler

no errors

HosMercury avatar Dec 26 '22 00:12 HosMercury

Is the button inside of an Alpine component? Is the button text working?

ryangjchandler avatar Dec 26 '22 12:12 ryangjchandler

Yes the text works perfectly

HosMercury avatar Dec 26 '22 13:12 HosMercury

I just ran into an issue where x-tooltip.raw didn't show without an empty x-data on the same element (didn't test a parent), but perhaps it's not finding the data?

I don't think the raw modifier is meant to require x-data though, right @ryangjchandler?

timothyis avatar Jan 18 '23 11:01 timothyis

@timothyis x-data is required, since that is what evaluates Alpine directives.

ryangjchandler avatar Jan 18 '23 11:01 ryangjchandler

In which case, this section of the readme is confusing https://github.com/ryangjchandler/alpine-tooltip#raw-text

timothyis avatar Jan 18 '23 15:01 timothyis

I wouldn't say so. The package is an Alpine plugin and therefore implies that you're using it inside of an Alpine component? If you want to update that, feel free to send a PR!

ryangjchandler avatar Jan 18 '23 15:01 ryangjchandler