离子应用程序:控制台错误忽略尝试取消touchstart事件

时间:2016-08-05 09:37:42

标签: ionic-framework

当用户滚动collection-repeat长列表时,我在离子应用中收到此错误。

ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

知道这是什么吗?

模板:

<div class="scrollContainer">
    <ion-scroll zooming="false" direction="y" overflow-scroll="false">

        <div class="loadingboards" ng-if="!transitionFinished">
            <ion-spinner class="spinner spinner-ios">
            </ion-spinner>
            <br/>
            Loading boards list...
        </div>

        <div id="boardselection" ng-if="transitionFinished">
            <ion-item collection-repeat="item in prodataSelect | orderBy:data.sort | filter: data.selectBrand.brand:true | filter: data.selectName.name | unique:'modelStrict'" item-width="96%" item-height="'18%'">

                <a class="optionfuninit item-content" data-proid="{{item.id}}" ng-click="whatToDo(item.id,$event);" ng-class="item.fun == '0' ? 'aNormal' :( item.fun == '1' ? 'aSmallWave' : (item.fun == '2' ? 'aStepUp' : ''))">
                    <img class="imageoptionsbrand" ng-src="{{ imagesUrls[(item.brand | lowercase | nospace)+'.png'] }}" />
                    <div class="listviewTrophy" ng-if="isWinning(item.id)">
                        <i class="icon ion-trophy"></i>
                        <div class="winningboardtext" translate="computepage.30">Winning Board</div>
                    </div>
                    <i class="icon ion-female" ng-show="item.gender == 'female'"></i>
                    <div class="listviewtexts" ng-class="item.fun == '0' ? 'aNormal' :( item.fun == '1' ? 'aSmallWave' : (item.fun == '2' ? 'aStepUp' : ''))">
                        <span class="listviewtextsmodel">{{item.modelStrict}}</span>
                    </div>
                    <div class="imagebox rotate90rightCenter">
                        <img class="imageoptionsmodel " ng-src="{{imagesUrls[item.imageName]}}" />
                    </div>
                </a>

            </ion-item>
        </div>

    </ion-scroll>
</div>

由于

2 个答案:

答案 0 :(得分:0)

对我来说,在文件vendor.js中注释了这些行

ToggleGesture.prototype.onDragStart = function (ev) {
    /*ev.preventDefault();*/
    this.toggle._onDragStart(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
};
ToggleGesture.prototype.onDragMove = function (ev) {
    /*ev.preventDefault();*/
    this.toggle._onDragMove(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
};
ToggleGesture.prototype.onDragEnd = function (ev) {
    /*ev.preventDefault();*/
    this.toggle._onDragEnd(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
};

答案 1 :(得分:0)

只需转到 ion-datetime 3-ios.entry.js 并评论第 1383 行:

detail.event.preventDefault();

您将摆脱错误:

<块引用>

[Intervention] 忽略尝试取消一个带有cancelable=false 的touchstart 事件,例如因为滚动正在进行并且不能被中断