-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(scrolling): update virtual scroll viewport size on resize #18058
fix(scrolling): update virtual scroll viewport size on resize #18058
Conversation
We currently cache the size of the virtual scroll viewport, but it may become inaccurate if it's a percentage of the page viewport and the page is resized. These changes add an extra call that'll update the virtual scroll viewport on resize. Fixes angular#16802.
b4a3b7b
to
6729515
Compare
scrollDispatcher: ScrollDispatcher) { | ||
scrollDispatcher: ScrollDispatcher, | ||
/** | ||
* @deprecated `viewportRuler` parameter to become required. |
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.
I would just mark this @breaking-change
, not @deprecated
since the change is making it required rather than removing it
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.
I’ve been marking these as deprecated in other places, because it’s something standard that’ll show up in people’s tooling, whereas breaking-change is something we made up.
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.
I see, I'm not sure if this will show up the way we want though, it will probably show viewportRuler
as a deprecated param. What might work better is TS's method overloading. We can mark the old signature deprecated and the new one not deprecated.
Obviously we already have this same pattern all over the code base, but it might be nice to start doing it the way I suggested going forward, I'll leave it up to you
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.
Good point that we should be using overloads instead, but I realized that Ivy won't generate the correct code if the constructor is overloaded with a different number of parameters. I've submitted a PR to fix the compiler here angular/angular#34590 so until that gets released I'll keep it as is.
Apply |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We currently cache the size of the virtual scroll viewport, but it may become inaccurate if it's a percentage of the page viewport and the page is resized. These changes add an extra call that'll update the virtual scroll viewport on resize.
Fixes #16802.