pappybuck
pappybuck
SSolidJS
Created by pappybuck on 7/9/2023 in #support
Run code on component becoming visible for first time
Hey @Jigz, this is actually for tauri component where I want to only download an image when it is visible for over a certain amount of time. The scroll itself is not infinite but some queries have over 200 results so this helps to only download the images that are actually needed for the user’s experience
11 replies
SSolidJS
Created by pappybuck on 7/9/2023 in #support
Run code on component becoming visible for first time
Got it to work by using createViewportObserver() and a boolean signal to check if the element has already been viewed. Thank you for your help!
11 replies
SSolidJS
Created by pappybuck on 7/9/2023 in #support
Run code on component becoming visible for first time
So I have around 60 components which are basically just a list item with a paragraph tag and image. These components are within an unordered list with css making it so there is about 5 list items visible at a time. There is a scrollbar to allow for the items to be scrolled so that all of them can be eventually viewed. Ideally I would like to run the function when the list item first comes into the viewport
11 replies
SSolidJS
Created by pappybuck on 7/9/2023 in #support
Run code on component becoming visible for first time
I tried that but unfortantly that runs when the component is mounted to the dom and not necisarily when it becomes visible
11 replies