Clicking on links in posts and go back makes incorrect post height

Hello :wave:

If I click an inline link in a topic post and go back to the topic than the posts has incorrect calculated (heigher) height.

Repro:

  1. Go to for example this topic Do we need a help button on the composer? - #13 by dodesz

  2. Click the link on that topic: New User Tips

  3. Go back to that topic with the browser or os native navigation. Or clicking the back link under the post.


On desktop view

On mobile view

Thank you :slightly_smiling_face:

7 Likes

A weird bug I came across. I can repro it, but I don’t know the exact criteria for it to happen.

  1. Open a short(?) topic

  2. Click a notification (or another link?) that makes you go to a long(?) topic

  3. Go back to the previous topic with your browser

  4. The short topic page is too tall, with mostly empty content

I could repro it starting from two short topics, using the same 2nd topic, and have trouble finding the exact context triggering the bug.

It only happens on mobile (Chrome on Android, Chrome Desktop on mobile view).

1 Like

Hello :wave:

I think this is relevant: Clicking on links in posts and go back makes incorrect post height

I think now I found a pattern for this bug. This is what I am thinking and it’s not sure this is happening. :slightly_smiling_face:

When you go back it keeps the previous topic next post(s) height (I think we can only see it visually if it is taller):thinking:

Let me clarify what I am thinking.

I opened two topic to demo it.

First topic

Second topic

I go from the first topic to the second topic and back. What happened? The first topic post’s are taller as I show it on the video here Clicking on links in posts and go back makes incorrect post height

Now I check the posts in first topic. Here is one.

It gets a calculated min-height.

Screenshot 2023-07-26 at 13.14.27

As I see this value calculation is find here and use the post-id attribute

So let’s check the post-ids and see what’s happened.

In the first topic post the post-id is 12.

In the second topic we have to find the post-id 13 post. Which is this.

This seems the post content height adds the empty space to the first topic 12th post.

As I see this is only happens if I use the slider loader. I am not sure what’s happening (but maybe because the loader slider is keeps page open while go back to the previous page) and starts the min-height calculation on the second topic and when I go back to first topic this calculation added to the actual posts height.

4 Likes

Oh, I could have made a search! :sweat_smile:
I’ve merged the posts, thanks!

And great detective work as well :chefs_kiss:

4 Likes