离子变化路线导致" TypeError:无法读取属性' scrollTo' of null"

时间:2014-12-11 02:27:19

标签: angularjs ionic-framework

在下文中,当我点击"搜索图标"时,控制台中会弹出以下内容

TypeError: Cannot read property 'scrollTo' of null
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:39909:17
at wrappedCallback (http://localhost:8100/lib/ionic/js/ionic.bundle.js:19197:81)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:19283:26
at Scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20326:28)
at Scope.$digest (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20138:31)
at Scope.$apply (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20430:24)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:21938:36
at completeOutstandingRequest (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12022:10)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12330:7

我在body标记

中有以下内容
<ion-header-bar class="logo-bar">
    <button class="button button-clear">
        <a ui-sref="root.home"><img class="pull-left" src="img/X.png"></a>
    </button>
    <h1 class="title">
        <a ui-sref="root.search" class="icon ion-search" nav-clear></a>
    </h1>
</ion-header-bar>

<ion-nav-view name="rootContent" class="main-body" animation="slide-left-right">
</ion-nav-view>

我的主页rootContent内容如下:

<ion-side-menus>
    <ion-side-menu-content>
        <ion-nav-bar class="app-menu bar-stable" animation="nav-title-slide-ios7" title="">
        </ion-nav-bar>
        <ion-view name="mainContent">
            <ion-content>
                This tag breaks click on SEARCH. Remove ion-content and it will work OK
            </ion-content>
        </ion-view>
    </ion-side-menu-content>
</ion-side-menus>

如果我要删除上面的ion-content标记,则错误消失。我想知道它有什么问题以及如何解决它。

- 修改

点击搜索点击rootContent中的下方,过渡到此处就是它突破的地方:

<ion-view>
  <div class="list list-inset">
    <label class="item item-input">
        <i class="icon ion-search placeholder-icon"></i>
        <input type="text" placeholder="Search" ng-model="searchTerm" ng-change="doSearch(searchTerm)">
    </label>
  </div>
 </ion-view>

1 个答案:

答案 0 :(得分:0)

这是Ionic beta 12中的一个错误。

它固定在高度构建(离子β13)

Download Nightly Build

Nightly build changlog

Read more about the bug