Heisenbug? Strange behavior when accessing dom width.

I have the need to access the dimensions of the EditorView on each update to the editor. Consequently, I listen for updates using EditorView.updateListener and in my handler I get the width and height of the view using code like the following:

totalWidth = this.editorView.dom.offsetWidth;
totalHeight = this.editorView.dom.offsetHeight;

The strange behavior that I am seeing is that each UI action (e.g. click or keypress) in the editor increases the width of the view by 10 pixels! If I just remove the line above which refers to the width the strange behavior goes away.

Any ideas what might be going on?

Thanks in advance.


Odd. Can you still reproduce this in a minimally reduced example script?

Thanks. I’ll give it a try, but I have a feeling that it will be difficult, as the EditorView is getting embedded in a larger web app.