namespace-ee / react-calendar-timeline

A modern and responsive react timeline component.
MIT License
1.91k stars 613 forks source link

Issue with getSumScroll Function while dragging the item using drag handle or by moving the item #900

Open Nikhil1489 opened 1 year ago

Nikhil1489 commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-calendar-timeline@0.28.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-calendar-timeline/lib/lib/utility/dom-helpers.js b/node_modules/react-calendar-timeline/lib/lib/utility/dom-helpers.js
index 4637dbc..313aa25 100644
--- a/node_modules/react-calendar-timeline/lib/lib/utility/dom-helpers.js
+++ b/node_modules/react-calendar-timeline/lib/lib/utility/dom-helpers.js
@@ -32,7 +32,7 @@ function getParentPosition(element) {
 }

 function getSumScroll(node) {
-  if (node === document.body) {
+  if (node === document.body || !node.parentNode) {
     return {
       scrollLeft: 0,
       scrollTop: 0

This issue body was partially generated by patch-package.