I noticed that if my div is on its 'static' location, it does resize like it shoud. But when it is in sticky position, it stays the same size on resize.
In your code I noticed that it can't resize because in calcDimensions(), it always uses it's own inner width.
dims.sidebarWidth = this.sidebarInner.offsetWidth; // OLD
An easy fix is to not use it's sidebarInner width, but it's sidebar width.
I noticed that if my div is on its 'static' location, it does resize like it shoud. But when it is in sticky position, it stays the same size on resize.
In your code I noticed that it can't resize because in calcDimensions(), it always uses it's own inner width.
dims.sidebarWidth = this.sidebarInner.offsetWidth; // OLD
An easy fix is to not use it's sidebarInner width, but it's sidebar width.
dims.sidebarWidth = this.sidebar.offsetWidth; // NEW/FIX