Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto scrolling a fixed positioned container doesn't work in IE11 #1088

Closed
InvisibleBacon opened this issue Feb 1, 2019 · 7 comments · Fixed by #1091
Closed

Auto scrolling a fixed positioned container doesn't work in IE11 #1088

InvisibleBacon opened this issue Feb 1, 2019 · 7 comments · Fixed by #1091

Comments

@InvisibleBacon
Copy link

Bug or feature request?

Bug

Expected behavior

Dragging an item to the edge of a fixed container should scroll the fixed container in IE11.

Actual behavior

In IE11, as soon as the browser starts to scroll the fixed area, a console error is raised and the drag is cancelled. The error is:

An error has occurred while a drag is occurring.
Any existing drag will be cancelled.
Invariant failed: Window scrolling is currently not supported for fixed lists. Aborting drag

Steps to reproduce

The behavior is visible on the story book: https://react-beautiful-dnd.netlify.com/?selectedKind=fixed%20list&selectedStory=with%20fixed%20sidebar&full=0&addons=0&stories=1&panelRight=0

  1. Open the above link in IE11.

  2. On the fixed container, drag and drop an item to the upper or lower edge of the screen.

  3. The drag will cancel. An error will appear in the console:

    Invariant failed

    (You have to be in dev mode to see the full error)

What version of React are you using?

16.7.0

What version of react-beautiful-dnd are you running?

10.0.4

What browser are you using?

IE11

Demo

It is reproducible on the story book site linked in "Steps to reproduce"

@alexreardon
Copy link
Collaborator

This is the line being triggered:

invariant(
      state.isWindowScrollAllowed,
      'Window scrolling is currently not supported for fixed lists. Aborting drag',
    );

@alexreardon
Copy link
Collaborator

I am not sure why this is being triggered only in ie11

@alexreardon
Copy link
Collaborator

It also looks like it is only triggered on the first drag. After that it is not hit..

@InvisibleBacon
Copy link
Author

Wow quick work! Thank you @alexreardon

@JakubSimandl
Copy link

JakubSimandl commented Mar 15, 2019

@alexreardon This issue is still present in the latest version.

if (event.currentTarget !== getWindow()) {
  return;
}

^ this line doesn't work, since in IE11, the .currentTarget is actually the window, because the event gets bubbled to the window, so it results in the original error.

@alexreardon
Copy link
Collaborator

Can you please check [email protected] to see if that fixes this issue?

@alexreardon
Copy link
Collaborator

Let me know @JakubSimandl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants