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

IE11 findDOMNode exception in click selection with multiple routes #1234

Closed
martin-strobel opened this issue Feb 22, 2019 · 5 comments
Closed

Comments

@martin-strobel
Copy link
Contributor

martin-strobel commented Feb 22, 2019

Do you want to request a feature or report a bug?

Bug

What's the current behavior?

Environment: IE11 with

  • react-big-calendar 0.20.3
  • moment 0.24.0
  • react 16.8.2
  • react-router 4.3.1
  • react-app-polyfill 0.2.1
  • babel-polyfill 7.2.5
    installed.

Test-URL: https://martin-strobel.github.io/rbc-ie11-bug/dashboard
Test-Repo: https://github.com/martin-strobel/rbc-ie11-bug/

How to reproduce bug:

  1. Open DEV-Console in IE11
  2. Click on a date
  3. Once weekview is visible: Try to select a timeslot or click somewhere else
    This also occurs after switching back to dashboard route.
  4. React shows error "Unable to find node on an unmounted component."

image

This seems to happen because of findDOMNode calls, but I was unable to fix this.
On an unrelated note: Sometimes timeslots are not rendered correctly, this doesn't seem to influence the reported bug.

This trace happened on the calendar (WeekView) page:
image

What's the expected behavior?

There shouldn't be any (uncaught) errors when switching between Routes.

@DenysZP
Copy link

DenysZP commented Mar 2, 2019

It seems that IE incorrectly or not fully unsubscribes from listeners.
I suggest adding isDetached flag to the Selection class.

class Selection {
  constructor(node, { global = false, longPressThreshold = 250 } = {}) {
    this.isDetached = false
    ...
  }

  teardown() {
    this.isDetached = true
    ...
  }

  _handleInitialEvent(e) {
    if (this.isDetached) {
      return
    }
    ...
  }
}

If this approach makes sense, I can create a PR.

@dkniffin
Copy link
Contributor

dkniffin commented Apr 5, 2019

I'm also experiencing this issue, and this change also fixed it for me. @jquense can you confirm that this is a good approach to fixing it, then @DenysZP can make a PR?

@dkniffin
Copy link
Contributor

dkniffin commented Apr 5, 2019

Additionally, adding another if (this.isDetached) { return } inside _handleMoveEvent addresses this other error that's coming up: Unable to get property 'x' of undefined or null reference

@vienpndn
Copy link

vienpndn commented Apr 9, 2019

I got same issues. Please let me know when will this issue be resolved? @jquense

@jquense
Copy link
Owner

jquense commented May 23, 2019

happy to take this PR if it helps

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

No branches or pull requests

5 participants