Skip to content

Timing error with overlay #8758

@shanegilbert

Description

@shanegilbert

Bug, feature request, or proposal:

I get the following error when using Overlay only when my data is returned from cache instead of pulled from the API.

TypeError: Cannot read property 'style' of null
at GlobalPositionStrategy.apply

This appears to come from line 159 in
https://github.com/angular/material2/blob/master/src/cdk/overlay/position/global-position-strategy.ts

What is the expected behavior?

No error

What is the current behavior?

The error occurs

What are the steps to reproduce?

Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.

Plunker starter (using on @master): https://goo.gl/uDmqyY

StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV

https://stackblitz.com/edit/angular-ow2o5c

What is the use-case or motivation for changing an existing behavior?

It appears to be a timing related issue. I am attempting to create a waiting indicator service using the overlay components and the mat-spinner

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 5.0.1
Material/cdk 5.0.0.rc.2
Typescript 2.5.3

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions