Skip to content

Commit f031618

Browse files
aniketaniket
authored andcommitted
fix: testimonials carousel swipe navigation stuck on mobile (#1667)
- Add touchEventsTarget='container' to Swiper so touch listeners attach to container instead of wrapper - Add grabCursor for visual drag feedback on desktop - Fix className bug: home && 'h-32' → home ? 'h-32' : '' to prevent 'false' string in DOM - Add touchAction: 'pan-y' on blockquote to allow horizontal swipes to pass through to Swiper Closes #1667
1 parent d3c9109 commit f031618

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/common/Testimonial/TestimonialCard.jsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ const TestimonialCard = ({ home, quote, name, avatarUrl, category, created_at, e
5353
</div>
5454

5555
<div className="mx-2 mt-4">
56-
<blockquote className={`${home && 'h-32'} max-h-32 px-6 overflow-y-auto`}>
56+
<blockquote
57+
className={`${home ? 'h-32' : ''} max-h-32 px-6 overflow-y-auto`}
58+
style={{ touchAction: 'pan-y' }}
59+
>
5760
<p
5861
className="leading-relaxed text-gray-700"
5962
dangerouslySetInnerHTML={{ __html: replaceWithBr() }}

‎src/common/Testimonial/TestimonialSection.jsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function TestimonialSection() {
3131
<div className="mx-5 lg:mx-20 h-72 mt-16 sm:mt-20">
3232
<Swiper
3333
rewind
34+
grabCursor
3435
autoplay={{
3536
delay: 2500,
3637
disableOnInteraction: false
@@ -56,6 +57,7 @@ function TestimonialSection() {
5657
}}
5758
slidesPerView={1}
5859
spaceBetween={10}
60+
touchEventsTarget="container"
5961
>
6062
{testimonials &&
6163
testimonials.map((testimonial) => (

0 commit comments

Comments
 (0)