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
Hi everyone, I'm looking for some basic ideas for how to add animations or transitions to flowbite-svelte table rows. Let's say I have a table like this:
And it renders something like this (the picture has some more features, but the above code should be accurate enough to get the point):
If a user inserts a new row, deletes a row, or some action triggers row reordering, I call invalidateAll() and it fetches new data, which should reflect the updated order, provided by the server. My goal is to animate this with some smoother transitions.
One challenge I'm running into is that svelte doesn't allow transitions or animations on components (e.g. Transitions can only be applied to DOM elements, not components svelte(invalid-transition)). Adding divs to wrap these components (similar to this discussion) in the context of a table does create the desired transitions, but creates layout issues. For example, if I try to just wrap the rows like this:
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
-
Hi everyone, I'm looking for some basic ideas for how to add animations or transitions to flowbite-svelte table rows. Let's say I have a table like this:
And it renders something like this (the picture has some more features, but the above code should be accurate enough to get the point):
If a user inserts a new row, deletes a row, or some action triggers row reordering, I call
invalidateAll()
and it fetches new data, which should reflect the updated order, provided by the server. My goal is to animate this with some smoother transitions.One challenge I'm running into is that svelte doesn't allow transitions or animations on components (e.g.
Transitions can only be applied to DOM elements, not components svelte(invalid-transition)
). Adding divs to wrap these components (similar to this discussion) in the context of a table does create the desired transitions, but creates layout issues. For example, if I try to just wrap the rows like this:Then we end up having display issues with the row widths, and other problems (horizontal lines, etc):
Is there any recommended workaround that could be employed to allow these transitions without messing up the table behavior?
Beta Was this translation helpful? Give feedback.
All reactions