Coder Social home page Coder Social logo

Comments (1)

leonardogbr avatar leonardogbr commented on May 23, 2024

@Hanzofm

I faced the same issue, but I found a workaround for this.
It happens because ion-refresher set the top style property and alpha-scroll also do this. So when you use the refresher for first time it duplicates the top property of alpha scroll.

Workaround:

In your template set an ID for the alpha-scroll

<ion-content no-bounce>
  <ion-refresher (ionRefresh)="doRefresh($event)">
    <ion-refresher-content
      pullingText="{{'pullto' | translate}}">
    </ion-refresher-content>
  </ion-refresher>

  <ion-alpha-scroll #alphaScroll
    [listData]="favorites"
    key="title"
    [itemTemplate]="alphaScrollItemTemplateRef"
    [currentPageClass]="currentPageClass"
    [triggerChange]="triggerAlphaScrollChange">
    ...
  </ion-alpha-scroll>
</ion-content>

In your page.ts use ViewChild to get alpha scroll element and than change doRefresh function. Set top: 0px to the .ion-alpha-sidebar. Something like this:

import { Component, ViewChild, ElementRef } from "@angular/core";
...
export class YourPage{

  @ViewChild("alphaScroll", { read: ElementRef }) alphaScroll: ElementRef;
  ...
  doRefresh(refresher) {
    for (let element of this.alphaScroll.nativeElement.childNodes) {
      if (element.className == 'ion-alpha-sidebar') {
        element.style.top = '0px';
      }
    }
    ...
  }  
}

It solved the problem for me. It's not a good solution but for now it works.

Hope it Helps.

from ionic2-alpha-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.