Topic List Previews keeps tile-grid-item class on topic-list-items

I have grid tiles enabled on discovery routes and tags lists. I don’t have them on category lists.

When initially navigating from a discovery route to a category list, I get this view:

After page-reload or after visiting a tags lists, it’s resolved:

I see that initially the tiles-grid-item class is still on the topic-list-item. The parent table has no classes from the component though.

Screenshot from 2024-01-27 11-58-26

This is on stable, 3.1.4.

1 Like

Something is in any case breaking your JavaScript. What does your console look like? Any errors?

1 Like

I just installed only the component on both tests-passed and stable. On both I get the same result on plain category lists as described above.

On tests-passed there’s no console errors, on stable there’s one warning:

Screenshot from 2024-01-28 19-18-21

OK got it.

This is a bug, I’ll try to fix it for tests-passed this week. Stable is only pinned, but don’t tend to back-port. Then again stable is about to sync!

1 Like

I’ve got rid of a couple of null exceptions. Try that!

Note that there still might be issue with specific theme you are trying to make it work with. At the very least you might have to tweak the grid CSS.

I suggest holding off testing on Stable until this weeks 3.2 update.

1 Like

Thanks, I still see the same layout issue on tests-passed though.

1 Like

ok I can repro that exact issue (I didn’t have the exact scenario dialed in).

so not only is the class lingering but the element is still a div. hmmm …

… I’ll take a look!

1 Like

This should be fixed now, please confirm.

(Perhaps by changing the tag, a link with the logic was lost as perhaps as the element was recreated, not mutated? Now that it’s mutated, the automated class associations work correctly?)

(btw, changing the tag may not be possible under glimmer, so this sets us up nicely to a more standard approach to the Topic List when Discourse gets rid of HBRs)

This fixed the issue.

I also found another redundant line and removed it:

This exercise has been helpful, thanks for the report!

1 Like

Yeah all good now. Thanks for the fix! :sparkles:

1 Like