Closed mdegans closed 2 months ago
Turning off persistence solved this. Not really a fix, but for me it's fine since nothing needs to persist.
Hmm, I guess the size of some widgets get's persisted by egui in a weird state, I had something like this before, where the size of some widget was nan in egui's persistent memory and only resetting memory would bring it back. Not sure if this is something caused directly by infinite scroll. But I never tried using the infinite scroll with collapsible headers, I'll try and see if that breaks something.
That would make sense. I just investigated the .ron
with a commit just before I disabled persistance. There's almost no app state, which is why I disabled it. The elements that are broken aren't serialized. By deleting keys, I found the line that was causing the problem:
{
...
"app": "(navbar:(expanded:false,selected_tab:Info,state:{}),central:())",
...
No NAN/Infinity, but somehow that breaks it. If I delete that and everything defaults, it works. And now that I check, I have derived Default
(on the Gallery
), which skips the new
which loads the actual data. But If i delete Panel
, this implementation of Default
is used which loads the data correctly:
impl Default for Panel {
fn default() -> Self {
Self {
commonmark_cache: Default::default(),
gallery: Gallery::new(include_str!("../../assets/gallery.json")),
doggos: Gallery::new(include_str!("../../assets/doggos.json")),
blog: Blog::new(),
}
}
}
So, this is on me. I could fix this by just removing serde from the parent Panel
and then Default
gets called every time. Closing as the issue is not with your library.
On Microsoft Edge (macOS), Chrome (macOS) as well as macOS native. instances of
InfiniteScroll
only show up the first time the executable is run. To repro, my website is here and the commit to repro here.The first time the site is run, the infinite scroll elements display:
After a refresh, the area where they should be shows as blank:
Clearing the site cookies resolves the issue once, but after a refresh, the widgets are gone again. This happens on native as well (at least macOS).
To aid in debugging and to point you to where the elements are used in my source, egui settings are available under the right navbar.
I'll investigate this myself but would appreciate input if the cause is known or if I'm "holding it wrong".