Ionic 3 Infinite Scroll'无法读取null的属性时间戳'

Ada*_*ank 7 infinite-scroll ionic2

所以我使用无限滚动来加载一个非常大的反应形式.但是我注意到,如果在无限滚动加载其他项目时触发了表单输入事件,则会发生这种情况.

    ERROR TypeError: Cannot read property 'timeStamp' of null
    at InfiniteScroll._onScroll (infinite-scroll.js:229)
    at SafeSubscriber.schedulerFn [as _next] (core.es5.js:3647)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)
    at Subscriber._next (Subscriber.js:125)
    at Subscriber.next (Subscriber.js:89)
    at EventEmitterProxy.Subject.next (Subject.js:55)
    at EventEmitterProxy.EventEmitter.emit (core.es5.js:3621)
    at ScrollView.scroll.onScroll (content.js:378)
    at ScrollView.setScrolling (scroll-view.js:52)
    at ScrollView.scrollTo (scroll-view.js:401)
    at Content.scrollTo (content.js:433)
    at TextInput._jsSetFocus (input.js:524)
    at TextInput._pointerEnd (input.js:496)
    at Object.eval [as handleEvent] (TextInput.ngfactory.js:130)
    at Object.handleEvent (core.es5.js:11998)
    at Object.handleEvent (core.es5.js:12717)
    at dispatchEvent (core.es5.js:8614)
    at core.es5.js:9228
    at HTMLDivElement.<anonymous> (platform-browser.es5.js:2648)
    at HTMLDivElement.wrapped (raven.js:350)
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:3881)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at e.invokeTask [as invoke] (polyfills.js:3)
    at p (polyfills.js:2)
    at HTMLDivElement.v (polyfills.js:2)
    console.(anonymous function)    @   console.js:32
    defaultErrorLogger  @   core.es5.js:1020
    ErrorHandler.handleError    @   core.es5.js:1080
    IonicErrorHandler.handleError   @   ionic-error-handler.js:61
    webpackJsonp.381.SentryErrorHandler.handleError @   sentry-
    errorhandler.ts:11
    (anonymous) @   core.es5.js:9232
    (anonymous) @   platform-browser.es5.js:2648
    wrapped @   raven.js:350
    t.invokeTask    @   polyfills.js:3
    onInvokeTask    @   core.es5.js:3881
    t.invokeTask    @   polyfills.js:3
    r.runTask   @   polyfills.js:3
    e.invokeTask    @   polyfills.js:3
    p   @   polyfills.js:2
    v   @   polyfills.js:2
Run Code Online (Sandbox Code Playgroud)

它真的让我发疯,因为即使是试试捕获也不能阻止这个错误导致应用程序崩溃.我需要帮助!!

gan*_*ney 3

这是当前的 ionic 问题,不幸的是,它看起来不会在 v4 之前得到修复。

bug(无限滚动):如果在解析之前调用scrollToTop,则会抛出无法捕获的错误

尝试避免该问题的最快方法(并非每次都有效)是在scrollToTop /scrollToBottom周围包裹一个setTimeout

setTimeout(function(){
    this.content.scrollToBottom()
},200);
Run Code Online (Sandbox Code Playgroud)