ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.93k stars 13.52k forks source link

[4.0.0-beta.3] click stops working with ion-slides on scroll #15301

Closed persn closed 5 years ago

persn commented 6 years ago

Bug Report

Ionic Info

cli packages: (C:\Users\MyUser\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

System:

    Node : v8.11.4
    npm  : 6.4.0
    OS   : Windows 10

Misc:

    backend : pro

Describe the Bug If I do a scroll down on a page with a ion-slides component then all click events for that component and children stops working. Only reproducible on some OS and web browsers, I have tested with Windows 10 and Chrome, but it seems to work fine on Ubuntu with Chromium.

Steps to Reproduce Steps to reproduce the behavior:

  1. Fill a page any filler content, enough to fill a page so that the scroll bar is showing.
  2. Add
    <ion-slides>
    <ion-slide>
      <ion-button (click)="onClick()">Click me</ion-button>
    </ion-slide>
    </ion-slides>
    onClick(): void {
    console.log('Do I work?');
    }
  3. npm run start
  4. Open app
  5. Scroll down (scroll bar or mousewheel, doesn't matter)
  6. Click button
  7. Nothing happens

Related Code Minimum code https://github.com/persn/ionic-slides-scroll-bug

Expected Behavior I expect to be allowed to click the content of ion-slides after doing a scroll

Additional Context It might be related to this https://github.com/nolimits4web/swiper/issues/1152

steinjak commented 6 years ago

Any progress on this?

paulstelzer commented 5 years ago

Is this issue still exist in beta.17?

persn commented 5 years ago

I updated ionic in my reproduction code, and the issue still persists.

paulstelzer commented 5 years ago

I think you have to add some css things because by default the slider is aligned middle, but I will take a look

paulstelzer commented 5 years ago

Can confirm this issue!

BTW, even if the button is above the list and you scroll first, the button is not working anymore . Now it's the question if this is an issue of swiper.js or Ionic

Could make it work after I locked the swipes

@ViewChild('slides') slides: Slides;
this.slides.lockSwipes(true);

  <ion-slides #slides>
    <ion-slide>
      <ion-button (click)="onClick()">Click me</ion-button>
    </ion-slide>
  </ion-slides>

2018-12-04_11-11-50

paulstelzer commented 5 years ago

I summarized at #16579 and will close this here. Please follow over there for any progress

ionitron-bot[bot] commented 5 years ago

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.