React-datepicker: Cannot read property 'outsideClickIgnoreClass' of undefined

Created on 30 Mar 2016  路  11Comments  路  Source: Hacker0x01/react-datepicker

Hi guys,

Firstly, thanks for a great date picker!

Everything has been working for a while, but after updating to meteor's latest stable version (1.3) I can't get it working again. I realise this could be a meteor issue so feel free to send me in that direction if it's clearly not a problem here.

The Problem
The component mounts fine and opens correctly on focusing the input, but when clicking outside the calendar to close it, I get the error "Cannot read property 'outsideClickIgnoreClass' of undefined". After looking into what's going on, it looks like the react-onclickoutside mixin is getting the wrong context somewhere along the line

var fn = this.__outsideClickHandler = (function(localNode, eventHandler) { 
  return function(evt) {
    evt.stopPropagation();
    var source = evt.target;
    var found = false;
    // this.props is undefined here, and 'this' is the document for some reason
    var ignoreClass = this.props.outsideClickIgnoreClass || IGNORE_CLASS;

Has anyone experienced this? Or is this possibly a meteor build issue?

bug

Most helpful comment

@tjcampbell, @janroesner, @andynoelker, the fix is merged, let us know if that fixes the issue for you

All 11 comments

Same issue here

Just did an update and started getting this as well

Making a fix in react-onclickoutside now, please hold

@rafeememon I can create a PR if it saves you some time?

Fix submitted at Pomax/react-onclickoutside#73. Once it merges and a new version is released this should be fixed.

Thanks @rafeememon

@tjcampbell, @janroesner, @andynoelker, the fix is merged, let us know if that fixes the issue for you

Works for me. Thank you!

Awesome! Sorry for the trouble.

@rafeememon are you guys going to do a release with the fix?

The new release of react-onclickoutside will be pulled in automatically if you reinstall

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericreis picture ericreis  路  3Comments

ahribori picture ahribori  路  3Comments

jcabrerazuniga picture jcabrerazuniga  路  3Comments

ro-savage picture ro-savage  路  3Comments

pinturic picture pinturic  路  3Comments