This is the default functionality of any browser and the functionality that users expect by eliminating it or preventing it, giving developers the opportunity to seriously change the user interface and, as a rule, is not possible, as well as a good idea.
In doing so, the first sentences that I have are as follows
1) set the CSS display of the object or its contents to "No" after full collapse.
2) delete the contents when minimizing and save it in memory to insert back when opening minimized contents.
3) after opening the minimized element, set scrollLeft to 0.