2

This is one of the weirdest bugs I've ever encountered. Some chance it's an extension or a browser bug or something but it only shows up on the app I'm building when I'm refreshing it in development mode, so stackoverflow seems like the right place to start asking.

Basically under certain as-yet-unknown circumstances, every time I reload the page I'm working on, the <body> element slides off the page to the left about 10px. And then when I refresh again it often slides even further. If I open the page in a new tab, it's fine.

In this screenshot below, I've highlighted the <body> element in the element inspector.

screenshot of Complice UI with interface slid off to the left

Clues:

  • it only happens sometimes, but once it happens almost every refresh increases the offset
  • certain absolutely-positioned elements like the navbar continue to fill the whole width of the html element, but others don't
  • the body element doesn't have any styles or classes it shouldn't have
  • changing the body element position to absolute doesn't affect it
  • the html element and the body element are still the same width
  • I'm using a 4k screen on linux (?!)

My best guess is something like... it's double-loading some sort of AngularJS directive, although I neither know why it would do that nor why that would cause this bizarre problem. At any rate, likely I'll be the one to solve this, some months or years from now, but if you've got any ideas, I'm curious!

MalcolmOcean
  • 2,807
  • 2
  • 29
  • 38
  • 2
    I have had this same bug usually in Chrome browser on windows OS, every time I update my `css` file the front-page looks like a cache is pre-loaded incorrectly. Another way to reproduce this error is reload the webpage when you are inside `inspect element`. How do I solved ? I switch to ubuntu 20.04 then I tried using `incognito mode` and I didn't receive the same bug once again. of course this is really radically solution. – Ragnar Jan 07 '22 at 17:36

1 Answers1

1

Not really an answer, I've had the same problem and it has something to do with my animation code in javascript. The thing that tricked me the most that only when I refresh at the specific element everything would switch to the left (even though I use the same code for animation in every part of my page) and then when I scroll all the way down it would reset itself back to normal. I think I won't try to fix it for now (because I don't know how to) but I'm really curious why is this happening.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/34933904) – technophyle Sep 01 '23 at 20:31
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/34933904) – SiKing Sep 01 '23 at 23:08