Comments (10)
Hi @nijlandvpr I'll look at adding support for this. I think it should just be a case of setting the text for the tooltip when it's toggled.
from alpine-tooltip.
@nijlandvpr Can you see the x-data
property changing in the inspector? Outside of a Livewire environment, changing the value of the property correctly updates the tooltip value.
I am able to reproduce the problem inside of a Livewire component. The x-data
does update in the DOM, so I'm actually going to guess that this is a problem with how Livewire & Alpine are working together, i.e. Alpine isn't correctly re-initialising the component when the DOM is patched by Livewire.
Even without the tooltip library, a simple x-text="tooltip"
doesn't update either.
from alpine-tooltip.
@ryangjchandler Thanks for taking the time on this. Yes, my scenario is inside a Liverwire component the x-data updates but the tooltip remains as it was when the page first loads.
from alpine-tooltip.
@nijlandvpr Yeah, I don't think this is a problem with the package. I'd recommend opening an issue / discussion on the Alpine or Livewire repo.
from alpine-tooltip.
@ryangjchandler Sure thing - I thought I'd start with the expert on the package. I'm also experiencing other issues with Livewire where some actions return a 404 to a "messages" route while others don't. Looks like it's losing how it recognizes DOM elements and substituting with a default - something like that anyway. New tech === "keep it simple stupid" is the message!
Thanks
from alpine-tooltip.
I encountered the same problem, I was able to solve it using @entangle
and an extra property in the Livewire component (where you should store "Enable" or "Disable")
from alpine-tooltip.
@rcubitto Are you saying you use @entangle to change the text of the tooltip?
x-data={ tooltip: @entangle('someStringProp') }
from alpine-tooltip.
@nijlandvpr yes, if the value of someStringProp
changes, the tooltip gets updated accordingly.
from alpine-tooltip.
@nijlandvpr yes, if the value of
someStringProp
changes, the tooltip gets updated accordingly.
The scenario I was looking at involved a backend rendered table, with rows containing a boolean is_disabled state. Even if is_disabled was text, looping through the rows as objects or array elements wouldn't entangle - I think!
x-data={ @entangle('user->is_disabled') }
from alpine-tooltip.
I'm going to close this issue for now since it's not a problem with the package, more of an Alpine/Livewire interop/compatibility thing.
If anybody comes here later looking for the same thing -- you can either use @entangle
/ $wire
to keep the prop in sync, or use a method on the Livewire component that returns the value, then inside of x-tooltip
do something like $wire.myMethod()
from alpine-tooltip.
Related Issues (20)
- extending the README.MD is desired? HOT 2
- How to use multiple modifiers simultaneously? HOT 2
- tooltip doesn't work when you add disable to button HOT 1
- Use tooltip as basis for a guided tour
- Themes HOT 2
- Html content HOT 2
- Add `$tooltip` magic variable HOT 2
- NPM package magic $tooltip missing HOT 2
- $tooltip not working with CDN? HOT 1
- How to use $tooltip in Fullcalendar 5 HOT 1
- Dynamic HTML content HOT 3
- Always show tooltip HOT 1
- Data not updated when combined with pagination HOT 3
- change background to white HOT 3
- The tooltip does not appear HOT 8
- Not a bug report: Load content through ajax request HOT 1
- Animation support? HOT 6
- How to change the font size of the tooltip? HOT 1
- Is there any way to use trigger: 'mouseenter click' ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpine-tooltip.