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

Content not receiving scroll event #10179

Closed
mattbryan9 opened this issue Jan 26, 2017 · 4 comments
Closed

Content not receiving scroll event #10179

mattbryan9 opened this issue Jan 26, 2017 · 4 comments

Comments

@mattbryan9
Copy link
Contributor

Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x

I'm submitting a ... (check one with "x")
[x] bug report
[] feature request
[] support request

Current behavior:

Content is not receiving the scroll event. Since the setters for many of its properties rely on this event to assign their values, the result is that while, for example getContentDimensions will successfully give us the correct contentHeight and scrollTop in the object it returns, we can't use scrollToTop because the instance members scrollTop and contentHeight are never set. When I put breakpoints in scroll-view.ts's scrollCallback, they are never hit, and when I add callbacks to ionScroll they are never called.

Expected behavior:

Content should always receive the scroll event when its contents are scrolled.

Steps to reproduce:

The Content that we have the issue with is a fullscreen Content inside of a Slider inside of a Content. However, when I try to reproduce the issue I cannot.

Related code:

This is the plunker I tried to reproduce the issue in--unsuccessfully, unfortunately.
http://plnkr.co/edit/9yHRflqnzFDWaXH3E5Fc?p=preview

Other information:

I can't be sure that this isn't a bug on our end since I'm unable to reproduce it, but since I can see that the Content has been scrolled when I use getContentDimensions it should definitely be receiving scroll events from the HTML. Unfortunately, I can't manually change the values of the properties I need to set to make scrollToTop work.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.6
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v4.5.0
Xcode version: Xcode 8.2.1 Build version 8C1002
@lumitor2
Copy link

lumitor2 commented Jan 26, 2017

I think I have similar problem after upgrade to 2.0.0. final. There is uncaught error which is called on scroll event.
Uncaught TypeError: Cannot read property 'ev' of null at Content._readDimensions (content.js:525) at dispatch (dom-controller.js:128) at DomController._flush (dom-controller.js:102) at rafCallback (dom-controller.js:95)
It's because this._scroll is not initialized in content.js file on line 525:
var scrollEvent = this._scroll.ev;
Maybe it's connected.

@ericcf
Copy link

ericcf commented Jan 26, 2017

I'm seeing something similar in 2.0.0 final. I've set up a new app using the "blank" template, and followed the testing setup suggested by Josh Moroney in his blog. After running and successfully completing a single Component test using the --single-run flag with karma, I see:

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  TypeError: null is not an object (evaluating 'this._scroll.ev')
  at webpack:///~/ionic-angular/components/content/content.js:525:0 <- src/test.ts:10518

I can see the same error in the console when I run the tests in Chrome.

Edit: this is replicable in rc.5 and rc.6. If I go back to rc.4, the error does not occur.

@jgw96
Copy link
Contributor

jgw96 commented Jan 26, 2017

Hello all! I am going to close this issue as a duplicate of #10186 as there is a workaround on that issue. Thanks for using Ionic!

@jgw96 jgw96 closed this as completed Jan 26, 2017
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 4, 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 4, 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

4 participants