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

Error in window resize when binding events #466

Open
jcubic opened this issue Dec 6, 2018 · 3 comments
Open

Error in window resize when binding events #466

jcubic opened this issue Dec 6, 2018 · 3 comments
Labels
Status: needs submitter response There's additional information to properly assess this issue.

Comments

@jcubic
Copy link

jcubic commented Dec 6, 2018

There is error in the code, the docs say to use this to bind events:

$('#dom-id').dateRangePicker();

but this will create window resize event with box as undefined and will throw exception.

This is always added:

$(window).on('resize.datepicker', calcPosition);

even if you request for picker object to bind events. To fix the issue, is to use this code instead:

$('#dom-id').bind('datepicker-change', onChange);
@jcubic jcubic changed the title Error in window resize Error in window resize when binding events Dec 6, 2018
@monovertex
Copy link
Collaborator

I'm not sure I understand what the issue is here. Can you provide a JSFiddle that showcases the bug?

@monovertex monovertex added the Status: needs submitter response There's additional information to properly assess this issue. label Dec 29, 2018
@jcubic
Copy link
Author

jcubic commented Dec 29, 2018

If you follow the API documentation, you have not working widget. so change event don't work at all as per API docs and instead you have exception in console. Will try to create fiddle with error using wrong API from docs. But right now I don't have access to the code I was using. It's on my work laptop.

@jcubic
Copy link
Author

jcubic commented Jan 7, 2019

Here is fiddle https://jsfiddle.net/zcgtLehf/
if you call this

$('#dom-id')
.dateRangePicker()
.bind('datepicker-first-date-selected', function(event, obj) {
});

as per docs. And as per code, the plugin will be initialized twice but second time it will be broken. Open dev tools. When you focus the input, it will throw exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: needs submitter response There's additional information to properly assess this issue.
Projects
None yet
Development

No branches or pull requests

2 participants