MaTeMaTuK / gantt-task-react

Gantt chart for React with Typescript
MIT License
899 stars 494 forks source link

fix: optimize scroll #194

Closed AlbajramiKevin closed 1 year ago

AlbajramiKevin commented 1 year ago

optmizes the scroll by relying on css and not stated. The existing solution was causing far too many rerenders because of a useEffect that was calling setStateX while being dependent on stateX. I just did a bunch of css changes, to make the overall scroll feel way more natural and simple. Dont feel I broke anything, but still fail to understand what was the point of doing the scroll in tehe way that it was before. Didnt clean the entire project, since I ran into another coupld of major bugs that need fast fixes.

Kcamplone commented 11 months ago

@AlbajramiKevin I had same issues and i downloaded ur code and looks good but if i set ganttHeight={540} for example, verticall scroll doesnt work.

AlbajramiKevin commented 11 months ago

Yeah, I did those fixes and then noticed that if you set a max value for height it will break things. You could try placing that in a container somewhere, but my advice would be to not use this library tbh. If its a for a personal project thats fine, but for a real product I would suggest to look elsewhere or create something from scratch.

Kcamplone commented 11 months ago

Yes! I agree but we already use it so I have to fix those issues :D