Skip to content
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

virtual-scroll: Fixes scroll gap with autosize #11195

Closed
wants to merge 1 commit into from

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented May 6, 2018

This PR fixes the scroll gap that occurs at the end of a auto-sized scrolled. This resets the range and creates a new sample based on whats in view so we aren't 'predicting' the size and ending up with a gap.

Demo of issue: https://stackblitz.com/edit/angular-soc77e

@amcdnl amcdnl self-assigned this May 6, 2018
@amcdnl amcdnl requested a review from mmalerba May 6, 2018 20:54
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 6, 2018

// once we hit the bottom, we need to resample our range
// based on the items in view so we don't create a gap
if (renderedRange.end === viewport.getDataLength()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know that this fixes it, probably will want to find a way to do it that doesn't lose our size info though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I suspected this was more of a starting point rather than the actual fix.

@amcdnl amcdnl changed the title fix(scroller): Fixes scroll gap with autosize virtual-scroll: Fixes scroll gap with autosize May 17, 2018
@nasreddineskandrani
Copy link

nasreddineskandrani commented Jul 10, 2018

we need to see the reference of this issue in the other [root] ticket. Tag #823

@yogeshgadge
Copy link

yogeshgadge commented Sep 11, 2018

@amcdnl Will this fix the space that we get when used inside mat-select ?

<mat-form-field>
	<mat-select placeholder="State">
		<cdk-virtual-scroll-viewport [itemSize]="states.length">
			<mat-option *cdkVirtualFor="let state of states"
                                             [value]="state">
                              {{state}}
                         </mat-option>
		</cdk-virtual-scroll-viewport>
	</mat-select>
</mat-form-field>

https://stackblitz.com/edit/angular-h4xptu-dgjd87?file=app/select-reset-example.html ?

@CharlBest
Copy link

CharlBest commented Sep 18, 2018

@mmalerba it seems development on the autosize strategy had slowed/stopped. Is this because @amcdnl is on holiday/left for a while or are there other reasons for it?

And if it is because the team is just busy with other stuff that's fine just wanted to know. :)

@mmalerba
Copy link
Contributor

I'm the one primarily working on it, but I've been busy with other things lately. I'll have some time to work on it more after the 7.0 release

@CharlBest
Copy link

Ok thanks for the update. Appreciate it. Good luck for the major release.

@mmalerba mmalerba closed this Oct 23, 2018
@ngbot
Copy link

ngbot bot commented Oct 23, 2018

Hi @amcdnl! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants