Skip to content

Conversation

@arnotixe
Copy link
Contributor

@arnotixe arnotixe commented Jan 6, 2024

on ionic 7.5.5, swiper 11.0.4 the events table should probably be rewritten to have the prefix "swiper" added to all the events.

event called "init" in table -> swiperinit
and so on, for all events.

Reasons:

  1. I found that (init) didn't trig, but (swiperinit) found in the Swiper Element Docs did the trick.

  2. There are forum answers putting us on this track too:
    https://forum.ionicframework.com/t/ionic-7-angular-and-swiper-11-0-3-event-did-not-trigger/237358

Nice caveat I found, had me fooled at first:

The (click) event DOES work without the "swipe" prefix, but that's a generic click handler, not the Swipe click handler:

<swiper-container (click)="handler()"

receives a regular click event

<swiper-container (swiperclick)="handler()"

event.detail contains pointerup data. This is the ACTUAL Swipe (click) implementation, see https://swiperjs.com/swiper-api#event-click

I didn't edit the full table -- I'm not a guru and I could be barking up the wrong tree here, so I added this as a note for now o_O

on ionic 7.5.5, swiper 11.0.4 the table above should probably be rewritten to have the prefix "swiper" to all the events. 

event called "init" in table -> swiperinit
and so on for all events.


There are forum answers putting us on this track
https://forum.ionicframework.com/t/ionic-7-angular-and-swiper-11-0-3-event-did-not-trigger/237358

Nice caveat I found, did trick me at first:

The (click) event DOES work without the "swipe" prefix, but that's a generic click handler, not the Swipe click handler:

<swiper-container (click)="handler()"
receives a regular click event

<swiper-container (swiperclick)="handler()"
event.detail contains pointerup data. This is the ACTUAL Swipe (click) implementation, see https://swiperjs.com/swiper-api#event-click


Didn't edit the full table -- I'm not a guru and I could be barking up the wrong tree here, so I added it as a note for now    o_O
@arnotixe arnotixe requested a review from a team as a code owner January 6, 2024 18:24
@arnotixe arnotixe requested review from brandyscarney and removed request for a team January 6, 2024 18:24
@vercel
Copy link

vercel bot commented Jan 6, 2024

@arnotixe is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@arnotixe arnotixe changed the title Update slides.md Correct names for swiper element events use "swiper-" prefix Jan 6, 2024
@liamdebeasi
Copy link
Contributor

Hey there! Apologies for the delay. I appreciate you making this PR. I am going to consolidate this with #3435, and I will give you co-author credit when the PR merges. Let me know if you have any questions. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants