NejcZdovc / ng2-select2

Select 2 wraper for angular2
MIT License
123 stars 93 forks source link

Fix: set value to null when clearing from a single select select2 and null check in ngOnDestroy #74

Open tjwoods58 opened 7 years ago

tjwoods58 commented 7 years ago

Closes #61

piernik commented 7 years ago

Is this fix gonna be published?

ricavir11 commented 7 years ago

Hi, I'm also wondering when this fix will be published... It would be great !

MarkHerhold commented 6 years ago

@NejcZdovc Do you have any plans to merge this?

NejcZdovc commented 6 years ago

@MarkHerhold did you try out hits patch? Is it working for you with this fix?

MarkHerhold commented 6 years ago

@NejcZdovc Partially. I can't directly reproduce the issue but I know that the if check will only prevent potential errors. I would actually go further than this PR does and check that off is a function and not just that it exists.

I can't comment on the other portion of this PR as we don't have issues with the select/unselect events.

I will submit a PR that only adds the if check as that's what I can validate and I know it's a safe change. Are you OK with this @NejcZdovc ?

NejcZdovc commented 6 years ago

@MarkHerhold sounds good

sbanerjee302 commented 6 years ago

@NejcZdovc can you please merge this fix also ? facing a similar issue.

NejcZdovc commented 6 years ago

@sbanerjee302 can you please test this PR out and confirm that it's working correctly

sbanerjee302 commented 6 years ago

@NejcZdovc The null check in ngOnDestroy is definitely working which was the issue I was facing.

NejcZdovc commented 6 years ago

@MarkHerhold said that he will do a pr just for this null check, so we can merge that one

sbanerjee302 commented 6 years ago

@NejcZdovc I have created a PR for the null check and also added a check if the off function exists. Can you please review.

NejcZdovc commented 6 years ago

@sbanerjee302 done, merged and new version published ng2-select2@1.0.0-beta.16