This is to fix inaccurate widths being applied from getWidthFrom, under specific conditions:
box-sizing of the container is border-box
the container has left or right padding
the element being stickied is being used as getWidthFrom
Under these conditions, when the sticky element is changed to position:fixed, it's width becomes equal to the width of the container + left/right padding on the container (due to border-box). This can lead to unexpected widths being applied to the stick element. Calculating the width from getWidthFrom before setting position:fixed fixes this issue.
This is to fix inaccurate widths being applied from getWidthFrom, under specific conditions:
Under these conditions, when the sticky element is changed to position:fixed, it's width becomes equal to the width of the container + left/right padding on the container (due to border-box). This can lead to unexpected widths being applied to the stick element. Calculating the width from getWidthFrom before setting position:fixed fixes this issue.