Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Console Error when reloading Vue component #35

Closed
desainr opened this issue Mar 5, 2019 · 2 comments
Closed

Console Error when reloading Vue component #35

desainr opened this issue Mar 5, 2019 · 2 comments
Labels

Comments

@desainr
Copy link

desainr commented Mar 5, 2019

Hello, I have an app that reloads a Vue component when scrolling to the top or bottom of the page. I am getting the following console error:

vue-scroll.esm.js:30 Uncaught TypeError: Cannot read property 'scrollTop' of null
    at HTMLDivElement.fn (vue-scroll.esm.js:30)
    at invokeFunc (debounce.js:95)
    at trailingEdge (debounce.js:144)
    at timerExpired (debounce.js:132)

It is not 100% reproducible, but seems to happen when scrolling quickly or quickly back and forth. Looking into the code it seems like the event target is undefined in this case. Would it be appropriate to have a null check on target in the addEventListener() sub method fn() ?

@sseelbach
Copy link

+1

@wangpin34 wangpin34 added the bug label Apr 30, 2019
@wangpin34
Copy link
Owner

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

No branches or pull requests

3 participants