Skip to content

Scroll from 'body' tag can't be caught #100

Closed
@SerikDM

Description

@SerikDM

Version

2.2.1

Vue.js version

2.5

What is expected?

Catch scroll event from 'body' element

What is actually happening?

Scroll even isn't caught

How to reproduce this problem?

add style 'overflow-y: scroll' to 'body' element

Solution:
update 'getScrollParent' method to check for 'BODY' tag at last place
`
getScrollParent (elm = this.$el) {
let result

    if (!this.forceUseInfiniteWrapper && ['scroll', 'auto'].indexOf(getComputedStyle(elm).overflowY) > -1) {
      result = elm
    } else if (elm.hasAttribute('infinite-wrapper') || elm.hasAttribute('data-infinite-wrapper')) {
      result = elm
    } else if (elm.tagName === 'BODY') {
      result = window
    }

    return result || this.getScrollParent(elm.parentNode)
  }

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions