For specific browser widths, horizontal scroll bar appears

AI-generated summary

A minor UI bug occurs in the Discourse platform where a horizontal scroll bar appears for specific browser widths. tshenry reports the issue when the composer touches the window edges, particularly when the topic-progress indicator docks to the last post. The bug is reproducible in desktop Safari, Chrome, and Firefox. codinghorror humorously notes the difficulty of avoiding the issue on a 13" MacBook Pro. awesomerobot identifies the root cause: the topic progress bar is slightly wider than its container due to a border, causing a 2px overflow. The fix involves adjusting the width calculation by subtracting 2px. This issue also affected sam.

Just a minor bug here.

Repro Steps:

  • Enter a topic with a few existing replies
  • Hit reply on the first post
  • Scroll down past the last post with the composer open

Additional notes:

  • Can reproduce in desktop Safari, Chrome and Firefox
  • Browser window must be small enough to where the composer is touching the edges of the window
  • It seems to trigger when topic-progress indicator detaches from the composer and docks to the last post

Seems to go away with:

#topic-progress-wrapper.docked {
   right: 1px;
}

Illustration:

3 Likes

Make the browser a bit bigger, then? :wink:

2 Likes

:rofl: Unfortunately that would require buying a new computer! On a 13" MacBook Pro, the composer touches the edges of the window at maxed browser size.

Here’s another weird thing that can happen because of it:

https://streamable.com/7y8pc

With that said, this is a minor thing that the majority of users probably won’t encounter.

6 Likes

Maybe @awesomerobot can take a look at some point.

4 Likes

So turns out the topic progress bar was ~2px wider than its container (likely because of the border?), so when at right: 0; and at X/X progress it produced a slight horizontal scroll. The solution was to subtract 2 from the width calculation.

FYI @sam this was the same issue you were seeing.

11 Likes