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 TypeError: Cannot set property 'selected' of undefined #112

Open
MilosPopovic11 opened this issue Aug 13, 2020 · 2 comments
Open

ERROR TypeError: Cannot set property 'selected' of undefined #112

MilosPopovic11 opened this issue Aug 13, 2020 · 2 comments

Comments

@MilosPopovic11
Copy link

MilosPopovic11 commented Aug 13, 2020

I update angular to 10, and first problem I had was:
ERROR TypeError: Cannot read property 'nativeElement' of undefined
but I resolved that issue with updating slideshow on 1.3.0-beta.11 version.

Now I get: ERROR TypeError: Cannot set property 'selected' of undefined

And can not say when because it random behavior. Can not reproduce, it just happen sometimes.
Any idea what to do? Thanks

@hnviradiya
Copy link

hnviradiya commented Aug 20, 2020

I was able to reproduce this when I remove image from array.

like this.imageSources.splice(2, 1);

So when we are on currentindex 2 and we remove it from array, it is giving this error.

so as a workaround I first moved currentindex to index which exist in array (in my case I moved to previous slide).

this.slideshow.goToSlide(slideIndexToRemove - 1);

and then i was able to safely remove it from array using splice.

@MilosPopovic11
Copy link
Author

@hnviradiya thanks for reply, I was on vacation. Will try this solution.

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

No branches or pull requests

2 participants