## 2017-06-22

Tried to find the issue with the browser resetting the scroll bar rather randomly.

So I started logging and profiling, but could not pinpoint it down. It might have to do something with auto-persisting... or changing the dom in general.

There was a suggestion on the net, that changing a chrome flag should help here:
```
chrome://flags/#enable-scroll-anchoring
```

But it did not. Maybe it has something to to with "focusing" the body or somthing else?

Shit it was the focusing of body!


```
import * as cop  from "src/external/ContextJS/src/contextjs.js";
cop.layer(window, "DevLayer").refineObject(document.body, {
  focus() {
    console.log(lively.currentStack())
    console.log("body focus! Squeak!")
    var scrollLeft = this.scrollLeft
    var scrollTop = this.scrollTop
    var result = cop.proceed()
    this.scrollLeft = scrollLeft
    this.scrollTop = scrollTop
    return 
  }
})
DevLayer.beGlobal()
```

The source of the issue was ther persistence code that preserved and set the focus again, which had the side effect of also scrolling the world sometimes.


