Is it possible to preserve or set an initial scroll left? similar to scroll top?
I have a table, with sortable headers, when I scroll left, sort by a header, the table resets scrollLeft to 0.
My current fix is to use scrollerRef, keep track of horizontal scroll in the state, the scroll element and with a useEffect to set the ref.current.scrollLeft. However this is reset by another render, so I need a 0ms setTimeout to set it at the end of execution. This causing an annoying flash.
Is it possible to preserve or set an initial scroll left? similar to scroll top?
I have a table, with sortable headers, when I scroll left, sort by a header, the table resets scrollLeft to 0.
My current fix is to use scrollerRef, keep track of horizontal scroll in the state, the scroll element and with a useEffect to set the ref.current.scrollLeft. However this is reset by another render, so I need a 0ms setTimeout to set it at the end of execution. This causing an annoying flash.