This seems very similar to #433. I've been seeing this pop up in my error logs, but haven't been able to reproduce it locally.
TypeError: Unable to get property 'contains' of undefined or null reference
~/react-datepicker/~/react-onclickoutside/index.js?0b15 in i at line 41:0
40. var isSourceFound = function(source, localNode, ignoreClass) {
41. if (source === localNode) {
42. return true;
43. }
All the errors are coming from IE11.
This also seems similar to #398, but it might be something different since you're using IE11. Do you by chance have SVG elements on your page? (If so it could be the issue mentioned in the react-onclickoutside readme)
That was it! There are SVG elements on the page, and I was able to reproduce the error locally by opening the datepicker and then clicking inside an SVG.
Adding the DOM4 shim fixes the error. This classList shim, which I tried first, didn't solve the SVG issue for some reason.
Awesome, glad we figured it out! I'm curious if the shim given on MDN would work as well (https://developer.mozilla.org/en/docs/Web/API/Element/classList#JavaScript_shim_for_other_implementations) but regardless I'm happy you got it working for your case.
FWIW the MDN code is the same one I linked to, by @eligrey. Not sure why it didn't solve the problem -- the shim loaded, but classList still didn't exist on the SVGElement prototype.
Ah interesting -- @Pomax (author of onclickoutside) for your SA we were having trouble getting the shim working for SVG elements on IE11 here
nice, I'll update my readme to point to https://github.com/WebReflection/dom4
Most helpful comment
This also seems similar to #398, but it might be something different since you're using IE11. Do you by chance have SVG elements on your page? (If so it could be the issue mentioned in the
react-onclickoutsidereadme)