You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app, content is set via the data-tippy-content atrribute. The content changes with users' actions (with Alpine I update the attribute via :data-tippy-content).
I understand I need to let Tippy know about these content changes. Simply disabling and enabling the instance doesn't seem to do that though.
Based on what I found in other discussions and issues, I found that I can iterate through all elements with the data attribute and address _tippy.setContent() for each element. Somehow all except one element give undefined as the typeof. It's like I'm lucky and this works for the most important element:
But there are other elements that need their content updated too. And this approach in general feels clunky. I'd expected an updateAll() method similar to the hideAll() method. Or a way to reset the instance. What am I missing here—is my approach wrong? Is it to be expected that only one element has an active _tippy (when it's set up with delegation)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In my app, content is set via the
data-tippy-content
atrribute. The content changes with users' actions (with Alpine I update the attribute via:data-tippy-content
).I understand I need to let Tippy know about these content changes. Simply disabling and enabling the instance doesn't seem to do that though.
Based on what I found in other discussions and issues, I found that I can iterate through all elements with the data attribute and address
_tippy.setContent()
for each element. Somehow all except one element giveundefined
as thetypeof
. It's like I'm lucky and this works for the most important element:But there are other elements that need their content updated too. And this approach in general feels clunky. I'd expected an
updateAll()
method similar to thehideAll()
method. Or a way to reset the instance. What am I missing here—is my approach wrong? Is it to be expected that only one element has an active_tippy
(when it's set up with delegation)?Beta Was this translation helpful? Give feedback.
All reactions