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

padding on the container and renderFromLast #37

Closed
evoactivity opened this issue Apr 13, 2017 · 8 comments
Closed

padding on the container and renderFromLast #37

evoactivity opened this issue Apr 13, 2017 · 8 comments

Comments

@evoactivity
Copy link

So my scroll container has padding on it, and I want to load scrolled to the bottom so I've set renderFromLast to true, this seems to work except the scroll position doesn't seem to take into account the container top and bottom padding.

I can work around this in my app with different css but I wonder if this should be handled by the library?

@pzuraq
Copy link
Contributor

pzuraq commented Apr 13, 2017

Hmm, that's a tricky one. Users can technically put any number of things before or after the vertical-collection component, like headers, footers, or other things. Theoretically it's supposed to be a drop-in replacement for each, so you should be able to use it like an each and expect it to flow with the rest of the document correctly(-ish). So I'm not sure what the more intuitive behavior would be here.

One possible solution would be to set the initial scrollPosition value to some absurdly large number, but I don't know if that's any better.

@pzuraq
Copy link
Contributor

pzuraq commented Apr 17, 2017

Quick update, scrollPosition is definitely not recommended, we're removing it for beta.2.

@runspired any thoughts here? If idForFirstItem is not provided it does kind of make sense to have renderFromLast render from the bottom of the scrollContainer rather than the last element. I could see it going either way.

@runspired
Copy link
Contributor

I need more context on this issue, as I understand it, is the layout this?

<scroll-container>
   <some-header />
   <vertical-collection />
   <some-footer />
</scroll-container>

@evoactivity
Copy link
Author

@runspired

my instance is more like so

<some-header />
<scroll-container>
   <vertical-collection />
</scroll-container>
<some-footer />

Then to keep my collection items from being flush I added padding to the scroll container. So let's say my padding was 20px all around, the renderFromLast would goto the right item but be 40px too short.

@runspired
Copy link
Contributor

@evoactivity can you use margin instead for this? The trouble with padding is it's relatively hard to distinguish between height and padding, but it's not too hard to distinguish between margin and (height + padding).

@runspired
Copy link
Contributor

@evoactivity this should be fixed for static heights on master, and for dynamic heights when #84 lands.

@runspired
Copy link
Contributor

@evoactivity this should be fixed now, closing unless you encounter additional issue :)

@evoactivity
Copy link
Author

Nice one @runspired, I'll let you know if I run into anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants