'ScrollWidth return ClientWidth instead the currect value

I'm building a slider with React and framer motion. My idea is to subtract scrollWidth with offsetWidth to get the remaining width of the element. I always get the value of zero (somehow they are equal). I printed the object and I saw that scrollWidth value returns clientWidth instead.

In the object the value of scrollWidth is totaly different and I cant tell why. ScreenShot of the object



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source