vue-scrollmonitor icon indicating copy to clipboard operation
vue-scrollmonitor copied to clipboard

Incorrect docs for container prop

Open foundryspatial-duncan opened this issue 6 years ago • 0 comments

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.

foundryspatial-duncan avatar Mar 25 '19 21:03 foundryspatial-duncan