-
Notifications
You must be signed in to change notification settings - Fork 6.8k
virtual-scroll: add update method #11210
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
Changes from 1 commit
23d2084
d6c3c52
94ddfb7
1382b58
6402889
2c1625b
04bdfc3
bb92f06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,15 @@ export class CdkVirtualScrollViewport implements DoCheck, OnInit, OnDestroy { | |
this._detachedSubject.complete(); | ||
} | ||
|
||
/** Update the viewport dimensions and re-render. */ | ||
updateViewport() { | ||
const viewportEl = this.elementRef.nativeElement; | ||
this._viewportSize = this.orientation === 'horizontal' ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this also appears in the Promise above, can we extract it into a separate |
||
viewportEl.clientWidth : viewportEl.clientHeight; | ||
|
||
this._scrollStrategy.onDataLengthChanged(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels weird to be calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
} | ||
|
||
/** Attaches a `CdkVirtualForOf` to this viewport. */ | ||
attach(forOf: CdkVirtualForOf<any>) { | ||
if (this._forOf) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
updateViewportSize
to be a little more specific about the purpose