Skip to content

ConnectedPositionStrategy doesn't work properly if the overlay's content is dynamic #4155

Closed
@mjamin

Description

@mjamin

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Position the overlay correctly within the viewport if possible.

What is the current behavior?

Overlay is positioned exceeding the viewport if the overlay's contents are dynamic and there's no fixed width set.

What are the steps to reproduce?

https://plnkr.co/edit/9hUThjYmfC7ofpSBDdKU

If the overlay's content is dynamic, the actual dimensions of the overlay content are set after the positioning logic runs.

Workaround:

setTimeout(() => overlayRef.updatePosition()); // queue update when overlay is shown

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

Angular: 4.0.2
Material: 2.0.0-beta.3

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