Commit c68ccc9
perf(overlay): only compute and emit position changes if there are subscribers (#11431)
When emitting the `ConnectedOverlayPositionChange`, we have to compute whether the overlay is being clipped by the viewport or one of its parent scrollables. These calculations can be expensive, because they need the `ClientRect` of each element, however they won't necessarily be used by the consumer. These changes move things around so we only calculate the scrollable clipping if the consumer has subscribed to the `positionChanges` observable.1 parent 3dc3fcd commit c68ccc9
File tree
1 file changed
+20
-5
lines changed- src/cdk/overlay/position
1 file changed
+20
-5
lines changedLines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | | - | |
113 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
581 | 591 | | |
582 | 592 | | |
583 | 593 | | |
584 | | - | |
585 | | - | |
586 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
587 | 602 | | |
588 | 603 | | |
589 | 604 | | |
| |||
0 commit comments