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

Incorrect docs for container prop #6

Open
foundryspatial-duncan opened this issue Mar 25, 2019 · 0 comments
Open

Incorrect docs for container prop #6

foundryspatial-duncan opened this issue Mar 25, 2019 · 0 comments

Comments

@foundryspatial-duncan
Copy link

foundryspatial-duncan commented Mar 25, 2019

The docs say that the container prop is a DOM element, and that the ScrollContainer will use that element to watch for scrolling. In the actual code, it appears that the container prop is actually a boolean. Default is false and it listens for scrolls on the document body. If container is true, it just uses the ScollContainer component itself, which is a div (this.$el).

Looks like there's also an open PR related to this

So, instead of

<div class="my-container>
  <scroll-container :container="MyContainerDivDomElement">
    // ... items ...
  </scroll-container>
</div>

The correct way to use a custom container with the current version of this package is:

<scroll-container class="my-container" :container="true">
  // ... items ...
</scroll-container>

I prefer it this way, but the API docs are misleading right now.

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

1 participant