svelte-tiny-virtual-list icon indicating copy to clipboard operation
svelte-tiny-virtual-list copied to clipboard

Dynamic heights?

Open H4xX0r1337 opened this issue 2 years ago • 4 comments

I tried putting images into the VirtualList. After a bit of tinkering it works, but only until you resize the window. Because the image gets taller when the list gets wider, the VirtualList becomes misaligned. Is there an intended way to fix this or could a feature like this be implemented?

H4xX0r1337 avatar Mar 24 '22 22:03 H4xX0r1337

Would it be possible for you to send me a quick example of your problem on Svelte REPL?

jonasgeiler avatar Mar 25 '22 08:03 jonasgeiler

@skayo this is the closest i got https://svelte.dev/repl/5db342ee4e3c4fa4a3405cbcfe617471?version=3.46.4

H4xX0r1337 avatar Mar 25 '22 18:03 H4xX0r1337

Sorry, for the late reply, busy week... Anyways, it looks like the problem is that the function defined in itemSize doesn't get called when the window resizes. The recomputeSizes(index) method is used exactly for this kind of problem.

Here's a working example: https://svelte.dev/repl/54bac5809c9e4570ac11f4d86be4e64c?version=3.46.4 I hope this is what you were looking for.

jonasgeiler avatar Mar 30 '22 08:03 jonasgeiler

Hello again! Did I help solve your issue? I'd like to close this issue.

jonasgeiler avatar May 17 '22 12:05 jonasgeiler

Closing this now due to inactivity. Let me know if you need additional help.

jonasgeiler avatar Feb 12 '24 02:02 jonasgeiler