Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost spinner icon appearing on user directory #8

Closed
pr0way opened this issue Sep 10, 2017 · 6 comments
Closed

Ghost spinner icon appearing on user directory #8

pr0way opened this issue Sep 10, 2017 · 6 comments
Labels

Comments

@pr0way
Copy link

pr0way commented Sep 10, 2017

Hi! Today, when I looking for my forum users I find one alarming thing.

I do not know if I can throw it into the error section?
This is about the element:
error

Sometimes it is visible, but not always, although all users are already loaded.

PS. Sorry for my weak english.

@luceos
Copy link
Contributor

luceos commented Sep 11, 2017

I've noticed the same but haven't found the cause yet. Thanks for reporting I'll look into this.

@Braintelligence
Copy link

Strange, when I first installed Flarum today I didn't see this. Now after I needed to reinstall everything I have this problem as well.

@clarkwinkelmann
Copy link
Member

I have never experience it myself. But I'm sure it's still present, so I can't really close this.

If anyone has an install where it happens systematically I'd be happy to take a look.

@clarkwinkelmann
Copy link
Member

Well I shouldn't have written that so fast. I've just found a way to replicate it.

When already on the users page, if I run m.route('/users') in the console to load the same page again, the spinner shows up and doesn't disappear.

I suppose the same behaviour can be observed if there's a link to the users page and you click it twice.

Still not sure what code is responsible for it though.

@clarkwinkelmann clarkwinkelmann changed the title Load new element but all time? Ghost spinner icon appearing on user directory Jun 6, 2019
@clarkwinkelmann
Copy link
Member

I'm going through old issues. This one is kind of an old friend.

I have not experienced the issue again with User Directory since last year. Even my way to reproduce the issue does not work on my beta 12 right now. Maybe it's been magically fixed even though we changed nothing here and nothing appears to have changed in core regarding the spinner either.

I have however experienced the issue while developing other extensions.

It seems that in our old version of Mithril, Mithril is quite happy to reuse the DOM element of a Component for another Component. Because the spinner of spin.js is added directly as a child of the LoadingIndicator, it can end up moving to other components rendered in its place later.

To find a perfect workaround we'd need a way to reliably reproduce the issue. Some of the solutions include wrapping the loader in a keyed element, or wrapping it in multiple DIVs so that Mithril will have no choice but delete the parent of the spinner when re-rendering.

What's odd is that in this issue, the spinner appeared on top of the first post, even though it's a child of the load more section which is supposed to be at the bottom.

One reason could have been that because the load more section doesn't have a key, the div is re-used for the first keyed div of the user list. I have now added a key to the load more section so if the ghost spinner still happen, it should at least be pushed at the very bottom of the list.

This kind of nonsense will no longer happen in Mithirl v1+ where it's mandatory to key all children of an element if a single of of them is keyed.

I'm keeping this open for now but if there's no further report of the ghost spinner in beta 12, I'll close the issue.

@clarkwinkelmann
Copy link
Member

Now that Flarum uses Mithril 2.0, this will either not happen anymore or happen for different reasons. I'm closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants