rossmartin / ionic2-alpha-scroll

:arrow_up_down: :capital_abcd: Configurable Ionic 2 component for alphabetically indexed list with an alpha scroll bar.
MIT License
66 stars 22 forks source link

The height of the element keeps increasing #6

Closed CarsonChen1129 closed 7 years ago

CarsonChen1129 commented 8 years ago

Hi, thank you very much for developing this. When I install and apply this module to my app (an Ionic 2 app), I find out that the height of the ion-alpha-scroll keeps increasing (Won't stop, caused the app to crash). I strictly followed the instruction to set up everything. I would appreciate for any help. Thank you.

rossmartin commented 8 years ago

Thanks for reporting the issue. Can you let me know what platform this is for? Is it on a real device or in browser only?

Can you share the markup to your ion-content that has the ion-alpha-scroll ?

There is another issue open like this mentioning that the issue occurs when there are other elements inside the ion-content. I may need to revise the component to accommodate for this situation.

CarsonChen1129 commented 8 years ago

Hi Ross, thank you very much for the reply. I am developing an Android app, and the issue happened in the browser. (I haven't got a chance to test it on the real device since it is not working in the browser). I just simply put inside a , like the following:

<ion-content padding>
<ion-alpha-scroll *ngIf="glossary"
      [listData]="glossary"
      key="name"
      [itemTemplate]="alphaScrollItemTemplate"
      [currentPageClass]="currentPageClass"
      [triggerChange]="triggerAlphaScrollChange">
      </ion-alpha-scroll>
</ion-content>

Here is my ionic info just in case if it is a version issue:

Cordova CLI: 6.3.1 
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.23
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.1 Build version 8B62

Somehow I found an alternative solution to achieve one of the functionalities that was introduced by this amazing plugin (ScrollTo specific elements). Thank you very much again for developing this.

vineetdpnd commented 8 years ago

I am facing this issue on the browser. The scroll height keeps on increasing .

Following is my code :-

* <ion-alpha-scroll ngIf="resources" [listData]="resources" key="title" [itemTemplate]="alphaScrollItemTemplate" [currentPageClass]="currentPageClass" [triggerChange]="triggerAlphaScrollChange"> **

And my ionic version :-

Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.2 Ionic CLI Version: 2.1.8 Ionic App Lib Version: 2.1.4 Ionic App Scripts Version: 0.0.43 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.1 Xcode version: Not installed

rossmartin commented 8 years ago

@vineetdpnd What does your alphaScrollItemTemplate look like? What browser are you using?

piuen0 commented 7 years ago

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 commented 7 years ago

@vineetdpnd @piuen0 This is solved via https://github.com/rossmartin/ionic2-alpha-scroll/commit/26a4fae51e69bbb0f7639d6b6fdb7909a06a5deb

New version (1.0.8) will be available soon.

vineetdpnd commented 7 years ago

@rossmartin Thanks for the update , I will try it out later this weekend and let you know if it works fine .