React-calendar-timeline: position: fixed on ancestor breaks drag and drop

Created on 31 Dec 2019  路  3Comments  路  Source: namespace-ee/react-calendar-timeline

Bug
dragging an item does not work if there is an ancestor with position: fixed

To Reproduce
CodeSandbox

Expected behavior
I expect to be able to trigger move/resize on the items. Instead there is no response.

Screenshots
Screen Shot 2019-12-30 at 7 07 56 PM

Library Version
[email protected]

Desktop specs:

  • OS: macOS
  • Browser: Chrome
  • Version 79

Additional context
If I change line 40 of utility/dom-helpers from
if (node === document.body) {
to
if (node === document.body || !node.offsetParent) {
the issue goes away. This makes sense given the MDN docs on HTMLElement.offsetParent

I've opened a pr, if there is a better way to go about fixing this I'd be happy to help.

bug pending-release

Most helpful comment

@FridgeWalaby @danielcruser I will release this today. @danielcruser Thank you for digging into this and solving the issue

All 3 comments

I ran into the same issue.

@FridgeWalaby @danielcruser I will release this today. @danielcruser Thank you for digging into this and solving the issue

I am getting the same issue in the getSumScroll function in the dom-helpers file. Can we add the same check that is applied to getSumOffset to getSumScroll:
Error shown in console:
Screen Shot 2020-09-08 at 11 17 34 am
Error Traceback:
Screen Shot 2020-09-08 at 11 17 55 am
Old code with null node check in getSumOffset only:
Screen Shot 2020-09-08 at 11 19 58 am
Proposed new code with checks in both getSumScroll and getSumOffset
Screen Shot 2020-09-08 at 11 20 52 am

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebastienbinda picture sebastienbinda  路  5Comments

pvtran1995 picture pvtran1995  路  6Comments

aufgussmeister picture aufgussmeister  路  5Comments

capt-obvious picture capt-obvious  路  6Comments

neartik picture neartik  路  4Comments