Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollView is null when switching off of tabs view #2181

Closed
revie opened this issue Sep 11, 2014 · 6 comments
Closed

scrollView is null when switching off of tabs view #2181

revie opened this issue Sep 11, 2014 · 6 comments
Assignees
Milestone

Comments

@revie
Copy link

revie commented Sep 11, 2014

I'm running into an issue with today's release of Ionic (1.0.0-beta.12) that I wasn't experiencing with older versions. In my app, when navigating away from a view that has tabs, I've started getting this error show up:

Error: scrollCtrl.$element is null .link/<@lib/ionic/js/ionic.bundle.js:41174 Scope.prototype.$broadcast@lib/ionic/js/ionic.bundle.js:20368 Scope.prototype.$destroy@lib/ionic/js/ionic.bundle.js:20026 updateView@lib/ionic/js/ionic.bundle.js:42420 directive.compile/</eventHook@lib/ionic/js/ionic.bundle.js:42397 Scope.prototype.$broadcast@lib/ionic/js/ionic.bundle.js:20368 $StateProvider/$get/transitionTo/$state.transition<@lib/ionic/js/ionic.bundle.js:33645 qFactory/defer/deferred.promise.then/wrappedCallback@lib/ionic/js/ionic.bundle.js:18979 qFactory/ref/<.then/<@lib/ionic/js/ionic.bundle.js:19065 Scope.prototype.$eval@lib/ionic/js/ionic.bundle.js:20089 Scope.prototype.$digest@lib/ionic/js/ionic.bundle.js:19901 Scope.prototype.$apply@lib/ionic/js/ionic.bundle.js:20193 done@lib/ionic/js/ionic.bundle.js:15805 completeRequest@lib/ionic/js/ionic.bundle.js:16010 createHttpBackend/</xhr.onreadystatechange@lib/ionic/js/ionic.bundle.js:15953
ionic.bundle.js (line 17470)

and then, instead of going to the page I've selected, I'm instead sent to the last tab on my current view. I'm also occasionally getting this error:

Error: scrollView is null @lib/ionic/js/ionic.bundle.js:39362 timeout/timeoutId<@lib/ionic/js/ionic.bundle.js:21691 completeOutstandingRequest@lib/ionic/js/ionic.bundle.js:11901 Browser/self.defer/timeoutId<@lib/ionic/js/ionic.bundle.js:12202
ionic.bundle.js (line 17470)

but can't see yet how this one is triggered, though does seem to be related.

It seems like this is a result of changes implemented due to issue #1993, but I can't be certain. The only change I have in my app from the working version of Ionic I was using (1.0.0-beta.11) to this one was an implementation of the "expose-aside-when" addition to the side menu, but removing that option doesn't seem to solve the errors being thrown.

I'm sure a Codepen can probably explain this much better than I did. I'll work on setting one up.

@revie
Copy link
Author

revie commented Sep 11, 2014

Codepen can be found here: http://codepen.io/anon/pen/ebaLc

Just open the side menu and click "Settings". You should end up on the "Account" tab. Click "Settings" again sends you to the right page.

@Sjerd
Copy link

Sjerd commented Sep 11, 2014

Also experiencing this bug.

@revie
Copy link
Author

revie commented Sep 11, 2014

Realized that the Codepen I provided only shows the second error I reported. First error, although related to scrolling and tabs, seems to be specific to the "ion-infinite-scroll" functionality.

This codepen explains the problem a little better:
http://codepen.io/revie/pen/FADcr/

Scroll errors seem to occur:

  • When going to a detail view from an infinite scroll view
  • Moving away from a view that has an infinite scroll
  • Switching away from tabs view to another page (both infinite scroll view and basic)

Hope this helps.

@adamdbradley adamdbradley added this to the 1.0.0-rc0 milestone Sep 12, 2014
@adamdbradley adamdbradley self-assigned this Sep 12, 2014
adamdbradley added a commit that referenced this issue Sep 13, 2014
Check if scrollView is null when switching off of tabs view. #2181
@adamdbradley
Copy link
Contributor

I've made some updates to the nightly build to fix these errors:
8883c6c

Would you be able to test out 1.0.0-beta.12-nightly-452 or greater and let me know if it fixes your issue:
http://code.ionicframework.com/#nightly

Additionally, your example helped me find another bug which was hurting performance and not allowing your app to work correctly:
db83d66

Please let me know how its working, and thanks for creating the issue.

@revie
Copy link
Author

revie commented Sep 15, 2014

Adam,

Oooh. Very nice! Love how elegant your change is.

Works perfectly. Thank you so much!

@revie revie closed this as completed Sep 15, 2014
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants