# Nav.setRoot() does not work

**URL:** <https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318>\
**Category:** ionic-v3\
**Created:** [May 5, 2016, 10:14pm UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318 "2016-05-05T22:14:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![malma67](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@malma67](https://forum.ionicframework.com/u/malma67)\
**Post date:** [May 5, 2016, 10:14pm UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318/1 "2016-05-05T22:14:08Z")

</div>

Hi,

I have a button in my app that calls the method submitRequest() defined below:

```auto
    <button block (click)="submitRequest()">
           Submit Request
    </button>

```

```auto
    submitRequest() {
        console.log('request submitted');

        var request = this.formAnswers
        request['category'] = this.categoryName 
        
        this.nav.setRoot(Requests);
    }

```

This works absolutely fine in the browser. When testing on ios device the **first** time I click the button I get an exception in in the XCode terminal:

```auto
.
.
    2016-05-05 22:57:54.937 Projya[4724:2872858] request submitted
    2016-05-05 22:57:54.938 Projya[4724:2872858] ngOnDestroy
    2016-05-05 22:57:54.938 Projya[4724:2872858] EXCEPTION: Error during evaluation of "click"
    2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: EXCEPTION: Error during evaluation of "click"
    2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: ORIGINAL EXCEPTION: TypeError: null is not an object (evaluating '_this._el.removeEventListener')
    2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: ORIGINAL STACKTRACE:
.
.

```

What’s really strange is that the second time I click - it works just fine.

If I change this like to this.nav.push - everything works as well but the desired behaviour is to set a new root page.

I am using ionic2 beta 6.

Cheers.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [May 5, 2016, 10:17pm UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318/2 "2016-05-05T22:17:05Z")

</div>

Your thread topic talks of .subscribe(), but I’m not seeing it anywhere in your post.

---

<div class="post-metadata">

**Author:** ![malma67](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@malma67](https://forum.ionicframework.com/u/malma67)\
**Post date:** [May 5, 2016, 10:20pm UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318/3 "2016-05-05T22:20:16Z")

</div>

Apologies - I have updated the title.

submitRequest() used to save something to firebase and hence make use of .subscribe() - but I have eliminated that being the cause of the problem - this is happening even after a simple click.

---

<div class="post-metadata">

**Author:** ![malma67](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@malma67](https://forum.ionicframework.com/u/malma67)\
**Post date:** [May 5, 2016, 11:59pm UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318/4 "2016-05-05T23:59:31Z")

</div>

hmmm - seems like this might be the problem…!

> <https://github.com/ionic-team/ionic/issues/6303>

---

<div class="post-metadata">

**Author:** ![malma67](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@malma67](https://forum.ionicframework.com/u/malma67)\
**Post date:** [May 6, 2016, 12:08am UTC](https://forum.ionicframework.com/t/nav-setroot-does-not-work/51318/5 "2016-05-06T00:08:03Z")

</div>

Mystery solved - Virtual Scroll causes this bug… ! However I still don’t understand why this only shows up when running on the device?
