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

Getting errors in Angular when using the mbsc-datepicker as directive instead of the component. #481

Closed
luthor77 opened this issue Jan 7, 2021 · 8 comments
Labels

Comments

@luthor77
Copy link

luthor77 commented Jan 7, 2021

This error:
image

It is happening every time I change some configuration dinamically (I didn't test all configurations).

For example, I'm using 2 pickers to set the start and end of an event, when I set the start and change dinamically the "min" of the end, I get this error.

I tried making a workaround using the range picker to not have to modify the "min", but then I get the error when changing the "controls" dinamically, from ["calendar", "time"] to ["calendar"] when marking the event as allDay. But normally I get the error when the end has been setted, when using the range.

The error is happening like a loop, so it blocks the platform I'm working on, and it happens only when using the directive.

I'm using this version of angular and mobiscroll:
image

One observation, when I was using the version 4.10.6, I was only getting a maximum call stack error, when changing the "min" dinamically. Normally the errors occurs when the picker has value, and a configuration has changed, but doesn't matter in what order that was made, and that is true for the v4 and v5.

@dioslaska
Copy link
Contributor

Could you please put together a small example reproducing the issue? I'd like to see how and when are you changing the options.

@luthor77
Copy link
Author

luthor77 commented Jan 8, 2021

I tried making a reproducing example at stackblitz, but the @mobiscroll/angular-lite package are only at the v4.10.6. Do you have a way for me to create an example?

@dioslaska
Copy link
Contributor

We don't have publicly available packages for v5. Please open a support ticket at support@mobiscroll.com, and send the project without the node_modules folder or just send the ts/template of the sample component which reproduces the error.

@luthor77
Copy link
Author

luthor77 commented Jan 8, 2021

@dioslaska I made this repository, can it serve as an example for you or when I open a ticket support?
https://github.com/luthor77/mobiscroll-error

@dioslaska
Copy link
Contributor

Thanks, that will do it, I see the errors now.

@luthor77
Copy link
Author

Ok, I'll be looking foward for your feedback.

@dioslaska
Copy link
Contributor

We fixed this error in 5.0.3. Although I'm not sure why this was happening, it only occurred when used inside your custom component. The error happened from some subcomponents creating and destroying immediately, and on destroy some event listeners were incorrectly cleaned up. I fixed that issue and the error no longer appeared in the test application you sent.

@luthor77
Copy link
Author

Thanks for your support. I'll update our application.

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

No branches or pull requests

2 participants