Ionic 4, ion-slides vertical scrolling not working
Asked Answered
P

2

7

I have a component inside of ion-slide and its is the scroll not working

here is my code :

{{tab}}

<ion-slide style="height:100%">
  <main-search></main-search>
</ion-slide>

<ion-slide>

    <div style="height:100%">Page 2 </div>

</ion-slide>

Pedigree answered 24/2, 2019 at 17:54 Comment(3)
Could you please go into more detail, how is it not working, what are you expecting, what is happening?Unrestrained
@PLASMAchicken the main-search component contain a list of element that not scrolling verticalPedigree
@Pedigree now check my answerAriew
B
10

Please try this:

.swiper-slide {
    overflow-y: scroll;    
    display: block;    
}

https://forum.ionicframework.com/t/ionic-scroll-within-ionic-slide-not-working/47099/7

Bedrock answered 2/9, 2019 at 14:7 Comment(2)
why isn´t this working for me? I despair.Freiman
Nevermind. I set scrollY="false" in ion-content 😐Freiman
A
4

Please try following code:

.html

<ion-slides [options]="slideOpts"
                pager="true">
      <ion-slide>
        <ion-list>
          <ion-item>
            <h2>Some title1</h2>
          </ion-item>
          <ion-item>
            <h2>Some title2</h2>
          </ion-item>
          <ion-item>
            <h2>Some title3</h2>
          </ion-item>
          <ion-item>
            <h2>Some title4</h2>
          </ion-item>
          <ion-item>
            <h2>Some title5</h2>
          </ion-item>
          <ion-item>
            <h2>Some title45</h2>
          </ion-item>
          <ion-item>
            <h2>Some title46</h2>
          </ion-item>
        </ion-list>
      </ion-slide>

      <ion-slide>
        <ion-list>
          <ion-item>
            <h2>Some title1</h2>
          </ion-item>
          <ion-item>
            <h2>Some title2</h2>
          </ion-item>
          <ion-item>
            <h2>Some title3</h2>
          </ion-item>
          <ion-item>
            <h2>Some title4</h2>
          </ion-item>
          <ion-item>
            <h2>Some title5</h2>
          </ion-item>
          <ion-item>
            <h2>Some title45</h2>
          </ion-item>
          <ion-item>
            <h2>Some title46</h2>
          </ion-item>
          <ion-item>
            <h2>Some title1</h2>
          </ion-item>
          <ion-item>
            <h2>Some title2</h2>
          </ion-item>
          <ion-item>
            <h2>Some title3</h2>
          </ion-item>
          <ion-item>
            <h2>Some title4</h2>
          </ion-item>
          <ion-item>
            <h2>Some title5</h2>
          </ion-item>
          <ion-item>
            <h2>Some title45</h2>
          </ion-item>
          <ion-item>
            <h2>Some title46</h2>
          </ion-item>
        </ion-list>
      </ion-slide>
    </ion-slides>

.ts

  slideOpts = {
      initialSlide: 0,
      speed: 500
  };

.scss

For vertical scrolling

ion-slides{
  overflow-y: scroll;
}

For horizontal scrolling

ion-slides{
  overflow-x: scroll;
}
Ariew answered 27/5, 2019 at 4:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.