Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Carousel Swiper Styling & Direction #1023

Merged
merged 3 commits into from
Sep 3, 2023

Conversation

jsonMartin
Copy link
Contributor

πŸ“‘ Description

This PR fixes the custom Carousel styling which was lost when adding swiper component by re-adding custom imgCls and slideCls.

This PR also inverts the order of the carousel swiper direction to match expected behavior from other swiping libraries such as SwiperJS (swipe from left->right to go back, right->left to go forward).

See: #965

Status

  • Not Completed
  • Completed

βœ… Checks

  • My pull request adheres to the code style of this project
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

@stackblitz
Copy link

stackblitz bot commented Aug 29, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Aug 29, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
flowbite-svelte βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Aug 30, 2023 10:42pm
flowbite-svelte-update βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Aug 30, 2023 10:42pm

@shinokada
Copy link
Collaborator

On an iPad, swiping works but all buttons don't work. Can you have a look at it?

@jsonMartin
Copy link
Contributor Author

jsonMartin commented Aug 30, 2023

So I don't have a physical iPad to test with @shinokada, but I was able to reproduce in Chrome & Safari browser emulator. It also appears that it's not just the iPad, but the buttons are not working on any mobile device (including my Pixel Android phone).

Looks like the problem is caused on mobile devices because preventDefault is being called in the onDragStart function, which prevents the click handler from bubbling up to trigger the button press (which would be the native browser behavior). It appears that tap gestures are lost all together because the current code only handles touch events which are over the drag threshold.

I was able to fix this by saving the original browser event when the user first touches and then manually issuing "tap" gesture click handling if under the drag threshold (thus considered a "tap" instead of a "drag").

Tested working in iPad Browser Emulator in Chrome/Safari and on actual Pixel phone

@shinokada
Copy link
Collaborator

Thanks for the fix.

@shinokada shinokada merged commit 0a104e0 into themesberg:main Sep 3, 2023
4 checks passed
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.

None yet

2 participants