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

"Cannot read property 'offsetParent' of null" when changing the route on autocomplete selection #6259

Closed
massieb opened this issue Aug 7, 2018 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@massieb
Copy link

massieb commented Aug 7, 2018

//Use timeouts as since Angular 4.2, AfterViewChecked is broken and not called after panel is updated
if(this.suggestionsUpdated && this.overlay && this.overlay.offsetParent) {
setTimeout(() => this.alignOverlay(), 1);
this.suggestionsUpdated = false;
}

 TypeError: Cannot read property 'offsetParent' of null
     at DomHandler.push../node_modules/primeng/components/dom/domhandler.js.DomHandler.relativePosition (domhandler.js:80)
     at AutoComplete.push../node_modules/primeng/components/autocomplete/autocomplete.js.AutoComplete.alignOverlay (autocomplete.js:257)
     at autocomplete.js:80
     at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
     at Object.onInvokeTask (core.js:3813)
     at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
     at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
     at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:496)
     at ZoneTask.invoke (zone.js:485)
     at timer (zone.js:2054)

Works correctly when removing the timeout. on line 222

Using angular 6.0.3
Using Primeng 6.1.0-rc.1

@gaelmigliorini
Copy link

Same here

@rich4756
Copy link

rich4756 commented Sep 4, 2018

I am seeing the same thing here.
Angular 6.1.2
PrimeNG 6.1.0

@rich4756
Copy link

rich4756 commented Sep 4, 2018

Using workaround by @massieb is working nicely for me.

@siqueiradg
Copy link

Same problem :/

@JulienBier
Copy link

I was wondering if it was possible to merge this fix in the primeng librarie before the next release?

@cagataycivici cagataycivici self-assigned this Feb 28, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Feb 28, 2019
@cagataycivici cagataycivici added this to the 7.1.0 milestone Feb 28, 2019
cagataycivici added a commit that referenced this issue Feb 28, 2019
darkhelmet pushed a commit to weknowtraining/primeng that referenced this issue Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

6 participants