longbill/jquery-date-range-picker

Error "Cannot read property 'contains' of undefined" is thrown in a page without any calendar

Opened this issue · 3 comments

Hello all,

I'm using the daterangepicker (last version) in a Grails application. This library has been added to a main JS file, named as application.js. This file is used by Asset Pipeline plugin and requires jQuery and moment before using daterangepicker. This file is also loaded in the bottom of the page.

When the main view of the app is loaded, this error is thrown, when you clicked in some page area:

jquery.daterangepicker.js?compile=false:5565 Uncaught TypeError: Cannot read property 'contains' of undefined
    at IsOwnDatePickerClicked (jquery.daterangepicker.js?compile=false:5565)
    at HTMLDocument.outsideClickClose (jquery.daterangepicker.js?compile=false:7113)
    at HTMLDocument.dispatch (jquery-2.2.0.min.js?compile=false:3)
    at HTMLDocument.r.handle (jquery-2.2.0.min.js?compile=false:3)

Maybe is a problem in load order or something similar.

Any help is appreciate :)

Thank you.

Regards,
Miguel.

I am having the same issue. Wondering if you have found any solution?

I'm having this issue, too. Do you have any solution?

Hello @ArjunKishore (sorry for the very late reply) amd @MennStudio.

Sorry but I haven't tried if this issue is still happening. When I tried it, I haven't found any solution.

I'm apologize the inconvenience.