LOL sorry i have no idea how you found out that code!
Scroll bar causes board to reposition when moving pieces on the first rank

@AbhaySankar12, cmon man if you're pretty good at coding then you can figure out how to edit the code!

...
If I reduce the size of the board the issue does not happen. So I suppose the issue happens because the piece goes beyond the display area of the screen.
I applied a temporary fix to the issue by modifying the CSS of the page to include
html { overflow-y: scroll; }as per https://stackoverflow.com/a/7607206
Then it worked.
I'd also be interested in knowing how you 'applied a temporary fix to the issue by modifying the CSS of the page'?
I could imagine creating a test page with the HTML & CSS files on my hard-drive but are you saying that you modified the site's styling of one of its webpages in-situ?
This is my first post here so please forgive me if this is off topic. I experience this behavior in the latest Microsoft Edge, Firefox, Chrome and Brave browsers, so I suppose it holds true for any other browsers too.
I use the normal sized chess board for Puzzle Rush and Battle and also for solving puzzles, example - https://www.chess.com/puzzles/problem/759352/practice
When moving pieces on the first rank (in the above example - the rooks), if the piece goes below the boundary of the board when dragging it horizontally, then the vertical scrollbar appears on the page and the board itself re-positions. This is extremely annoying especially when you're trying to solve puzzles very fast during Puzzle Rush or Battle.
If I reduce the size of the board the issue does not happen. So I suppose the issue happens because the piece goes beyond the display area of the screen.
I applied a temporary fix to the issue by modifying the CSS of the page to include
as per https://stackoverflow.com/a/7607206
Then it worked.