In my React(NextJS) project using material UI, I have implemented tables (DataGrid component from material UI) with distinct background colors in the column headers, as shown below:
https://i.sstatic.net/zd3Iu.png
However, I encountered an issue where rapidly scrolling horizontally causes the colors to shift by 1 space/column. For example, the column "rank" should be yellow, but when scrolling quickly, it changes to red:
https://i.sstatic.net/du8C0.png
This sudden color shift by 1 space/column appears to be a potential bug in material UI, but I am uncertain...
Below is the code snippet of my React component:
// React component code here
Additionally, I utilize the "headerStyles" object as props, which contains the color configurations for each nth child/column:
// Header styles object here
If anyone has insights into why this issue occurs or how to resolve it, I would greatly appreciate the assistance.
Thank you.