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

.ion-alpha-scroll height increases ! #3

Closed
julianlecalvez opened this issue Oct 7, 2016 · 9 comments
Closed

.ion-alpha-scroll height increases ! #3

julianlecalvez opened this issue Oct 7, 2016 · 9 comments

Comments

@julianlecalvez
Copy link

Hello,

I have a bug when I try to use this plugin. Each time I start to click or scroll, the .ion-alpha-scroll element's height property is increasing ! So I have a huge white space at the end of the list and it's getting higher and higher !
I'm not sure about which causes that but it's really weird !

Julian

@rossmartin
Copy link
Owner

Thanks for letting me know and sorry for the delay I went to a friends wedding this weekend. I haven't updated this component for Ionic 2 RC0 so it is possible that is why you are experiencing this. I'll look into it this week.

@julianlecalvez
Copy link
Author

Hi!
No problem ! But i don't know if it's because of ionic 2 RC or if I'm not using it in a proper way :s
Thanks for checking on it, and I'll let you know if I find something as well ;)

@julianlecalvez
Copy link
Author

julianlecalvez commented Oct 10, 2016

ok I found something.
I have a <ion-searchbar></ion-searchbar> just above the list inside the ion-content.
It doesn't work with this search bar, but it works when I remove it. :(

EDIT:
it doesn't seem to be the search bar directly. If I put a margin-top on the ion-alpha-scroll. it starts to fail. Otherwise it works. I guess it's a calculation thing.

.ion-alpha-scroll {
        margin-top: 60px;
}

@julianlecalvez
Copy link
Author

ok so far I found a quick trick, but I don't think it's optimal.
The problem is because I tried to put another thing inside the <ion-content>
So, to avoid that and keep the alpha-scroll alone, I added an <ion-header-bar> BEFORE the <ion-content>, and I calculate the new size of the content at load.
It works but I think there's something in the plugin calculation which causes that if there's another element inside the <ion-content>.

Julian

@rossmartin
Copy link
Owner

Hey I haven't forgot about this but I've been so busy lately. Also I'm trying to get a personal app updated from Ionic 2 beta 11 to RC0 and it has been a real pain so far. I've only had about an hour to commit to the upgrade but once I'm done I'll be on this issue.

Thanks.

@piuen0
Copy link

piuen0 commented Dec 29, 2016

I tried to edit below lines in ion-alpha-scroll.js, and the problem fixed, see if it works for you.

*Changed height: dimensions.scrollHeight + 'px' to height: dimensions.contentHeight + 'px'

//line 62
IonAlphaScroll.prototype.calculateScrollDimensions = function () {
  var dimensions = this._content.getContentDimensions();
  return {
    height: dimensions.contentHeight + 'px',
    width: (dimensions.contentWidth - 20) + 'px'
  };
};

@rossmartin
Copy link
Owner

@piuen0 Thanks I'll take a look. I know the latest rc.4 brought some changes with it that has broken this component again :~(

@piuen0
Copy link

piuen0 commented Dec 30, 2016

@rossmartin Thanks for your effort to build this repo! This is useful

@rossmartin
Copy link
Owner

This is solved via 26a4fae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants