Coder Social home page Coder Social logo

Comments (5)

ryangjchandler avatar ryangjchandler commented on July 28, 2024

@marttheis As far as I know, when Livewire navigates and loads the new pages HTML, it will reinitialise Alpine and therefore the plugin should reinitialise too.

I believe the only exception to this is if the element is being persisted across pages.

from alpine-tooltip.

marttheis avatar marttheis commented on July 28, 2024

I was able to narrow it down a bit. When navigating to the exact url where the toolip is located, it works for continued navigation and everything is fine. However when I land on a URL without the tooltip and then navigate to the URL with the tooltip, it doesn't work because something was not initialized it seems. After a refresh on a page with a tooltips it works.

Maybe it messed up the x-data. I was not able to make the html links work with x-text="message", hence I skipped it and put it directly into the template. Is that correct?

<div class=" padbot flex justify-between items-baseline  w-full "> 
            
                    <div x-data="{ message: '' }" class="   text-tpri h2 flex ">Your notifications

                        <template    x-ref="template">

                             <p>Real time statistics of your portfolio. <a rel="noreferrer noopener" class="dont-break-out hover:underline text-p1" target="_blank" href="../documentation#docs1"> documentationofyourdocumentationstuffforyoutolearnmoreabout</a> Real time statistics Real time statistics of your portfolio. of your portfolio. Learn more in our <a rel="noreferrer noopener" class="dont-break-out hover:underline text-p1" target="_blank" href="../documentation#docs1"> documentation of your documentation stuff for you to learn more about</a></p>

                        </template>

                        <button ontouchstart:passive x-tooltip.interactive.debounce.200 x-tooltip="{content: () => $refs.template.innerHTML, allowHTML: true, theme: 'custom', placement: 'auto', inlinePositioning: false, appendTo: $root, interactive: true }" class="  padx text-tsecinv h2 flex justify-center items-center active:text-tpri hover:text-tpri  ">
                            <svg class=" h-5  " height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" ><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
                        </button>


                </div>

from alpine-tooltip.

marttheis avatar marttheis commented on July 28, 2024

I solved the isssue.

I have two main layouts. I only loaded the styles and css on one of them. Whenever I initially loaded the one without and navigated to the one with the styles and css it obviously needed a refresh.

from alpine-tooltip.

ryangjchandler avatar ryangjchandler commented on July 28, 2024

The button element has 2 separate tooltip directives, that'll likely be a problem.

from alpine-tooltip.

marttheis avatar marttheis commented on July 28, 2024

That wasn't the reason but thank you for pointing it out. I will get rid of the tippy syntax and add the debounce into the other one.

from alpine-tooltip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.