Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

when placed ngIf on ngx-mat-select-search error #53

Closed
rhyre opened this issue Aug 30, 2018 · 7 comments · Fixed by #54
Closed

when placed ngIf on ngx-mat-select-search error #53

rhyre opened this issue Aug 30, 2018 · 7 comments · Fixed by #54
Labels
bug Something isn't working minor

Comments

@rhyre
Copy link

rhyre commented Aug 30, 2018

When using ngIf to hide search, I've got following error.
version of angular: Angular6-latest
ngx-select: latest

TRACEBACK:

TableFiltersComponent.html:18 ERROR TypeError: Cannot read property 'changes' of undefined
    at MatSelectSearchComponent.push../node_modules/ngx-mat-select-search/esm5/ngx-mat-select-search.js.MatSelectSearchComponent.ngAfterViewInit (ngx-mat-select-search.js:97)
    at callProviderLifecycles (core.js:9567)
    at callElementProvidersLifecycles (core.js:9541)
    at callLifecycleHooksChildrenFirst (core.js:9531)
    at checkAndUpdateView (core.js:10467)
    at callViewAction (core.js:10699)
    at execEmbeddedViewsAction (core.js:10662)
    at checkAndUpdateView (core.js:10459)
    at callViewAction (core.js:10699)
    at execEmbeddedViewsAction (core.js:10662)
View_TableFiltersComponent_7 @ TableFiltersComponent.html:18
push../node_modules/@angular/core/fesm5/core.js.DebugContext_.logError @ core.js:11313
push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719
(anonymous) @ core.js:4588
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388
push../node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:138
push../node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular @ core.js:3783
push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick @ core.js:4588
(anonymous) @ core.js:4473
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:3824
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:387
push../node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:138
push../node_modules/@angular/core/fesm5/core.js.NgZone.run @ core.js:3738
next @ core.js:4473
schedulerFn @ core.js:3555
push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:195
push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:133
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54
push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ Subject.js:47
push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit @ core.js:3539
checkStable @ core.js:3793
onLeave @ core.js:3860
onInvokeTask @ core.js:3818
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:420
push../node_modules/zone.js/dist/zone.js.Zone.runTask @ zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
TableFiltersComponent.html:18 ERROR CONTEXT DebugContext_ {view: {…}, nodeIndex: 2, nodeDef: {…}, elDef: {…}, elView: {…}}
@macjohnny
Copy link
Member

@rhyre could you please provide your code? it would be even more helpful if you could adapt this example: https://stackblitz.com/github/bithost-gmbh/ngx-mat-select-search-example and show your issue.

@rhyre
Copy link
Author

rhyre commented Aug 30, 2018

when you add like showme=true and then <ngx-mat-select-search *ngIf="showme" [formControl] ...
on console it shows the same error in this example.

@macjohnny
Copy link
Member

@rhyre thanks for your bug report, I could reproduce your issue with this example: https://stackblitz.com/edit/github-wd7wt2?file=src/app/app.component.html

I will analyze it and try to find out what is wrong. or do you have an idea / time to find a fix?

@macjohnny macjohnny added bug Something isn't working minor and removed question labels Aug 30, 2018
@macjohnny
Copy link
Member

@rhyre I found the reason and I will release a fixed version soon.

@rhyre
Copy link
Author

rhyre commented Aug 30, 2018

Thanks, this will help a lot ! 😃

macjohnny added a commit that referenced this issue Aug 30, 2018
macjohnny added a commit that referenced this issue Aug 30, 2018
#53: fix Error thrown when using *ngIf on the mat select search component
@macjohnny
Copy link
Member

macjohnny commented Aug 30, 2018

@rhyre I released version 1.3.1 which should fix your issue. could you please check, too?
Btw: if you like the project, feel free to add a star on github.

@rhyre
Copy link
Author

rhyre commented Aug 30, 2018

works like a charm, thanks !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working minor
Projects
None yet
2 participants