Skip to content

fix: Testimonials Carousel Swipe Navigation Stuck on Mobile #1667#1670

Open
aniketmishra-0 wants to merge 2 commits intoreactplay:mainfrom
aniketmishra-0:fix/testimonials-carousel-swipe-navigation
Open

fix: Testimonials Carousel Swipe Navigation Stuck on Mobile #1667#1670
aniketmishra-0 wants to merge 2 commits intoreactplay:mainfrom
aniketmishra-0:fix/testimonials-carousel-swipe-navigation

Conversation

@aniketmishra-0
Copy link
Contributor

Bug Fix: Testimonials Carousel Not Working Swipe Navigation Stuck on Mobile

Closes #1667

Problem

The Testimonials carousel on the homepage was unresponsive to swipe/touch gestures on mobile devices. Users could not navigate between testimonial cards by swiping, making the carousel effectively stuck on the first visible slide(s).

Root Cause

Two issues were identified:

  1. Touch events captured by inner scrollable content Each TestimonialCard contains a <blockquote> with overflow-y: auto for long quotes. On mobile, this scrollable region intercepted horizontal touch/swipe events before they could reach the Swiper carousel, preventing slide transitions.

  2. Touch event listeners attached to wrong target By default, Swiper attaches touch event listeners to the wrapper element. When nested scrollable content exists inside slides, touch events get consumed before Swiper can process horizontal swipes.

Changes Made

File Change Why
TestimonialSection.jsx Added touchEventsTarget="container" prop to <Swiper> Attaches touch listeners to the Swiper container instead of the wrapper, ensuring horizontal swipes are captured even when inner elements have scroll
TestimonialSection.jsx Added grabCursor prop to <Swiper> Provides visual grab cursor feedback on hover, improving discoverability that the carousel is interactive
TestimonialCard.jsx Added style={{ touchAction: 'pan-y' }} to the scrollable <blockquote> Instructs the browser that this element only handles vertical panning, allowing horizontal swipe gestures to propagate up to the Swiper carousel

Testing

  • Verified carousel responds to horizontal swipe on mobile viewport
  • Verified autoplay still works correctly
  • Verified vertical scrolling inside long testimonial quotes still works
  • Verified keyboard navigation still functions
  • No build errors introduced

Screenshots / Demo

Tested on Chrome DevTools mobile emulation (iPhone 12 Pro, Galaxy S20) carousel now responds to horizontal swipe gestures.

CP-Tiwari added 2 commits February 7, 2026 15:22
Add a new play that calculates Basal Metabolic Rate and Total Daily
Energy Expenditure using the Mifflin-St Jeor Equation. Features include
metric and imperial unit support, five activity levels, weight loss and
gain calorie targets, responsive design, and smooth result animations.

Closes reactplay#1660
Copilot AI review requested due to automatic review settings February 8, 2026 16:57
@netlify
Copy link

netlify bot commented Feb 8, 2026

👷 Deploy request for reactplayio pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 56ed53b

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes mobile swipe interactions for the homepage Testimonials carousel by adjusting Swiper touch handling and nested scroll behavior. The PR also introduces a new “BMR & TDEE Calculator” play, which is unrelated to the stated carousel bugfix scope.

Changes:

  • Update Testimonials carousel configuration to better capture touch gestures on mobile.
  • Update testimonial quote container to allow vertical scrolling without blocking horizontal swipes.
  • Add a new “BMR & TDEE Calculator” play (component + styles + assets + README) and export it via src/plays/index.js.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/common/Testimonial/TestimonialSection.jsx Adds Swiper props (grabCursor, touchEventsTarget="container") to improve mobile swipe handling.
src/common/Testimonial/TestimonialCard.jsx Adds touchAction: 'pan-y' on the scrollable quote area to prevent it from capturing horizontal swipes.
src/plays/index.js Adds export for the new BMR/TDEE play (also broadens PR scope beyond the described bugfix).
src/plays/bmr-tdee-calculator/BmrTdeeCalculator.jsx New BMR/TDEE calculator play implementation.
src/plays/bmr-tdee-calculator/styles.css Styles for the new calculator play.
src/plays/bmr-tdee-calculator/cover.svg Cover asset for the new calculator play.
src/plays/bmr-tdee-calculator/Readme.md Documentation for the new calculator play (contains a formula inconsistency noted in comments).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<div className="mx-2 mt-4">
<blockquote className={`${home && 'h-32'} max-h-32 px-6 overflow-y-auto`}>
<blockquote className={`${home && 'h-32'} max-h-32 px-6 overflow-y-auto`} style={{ touchAction: 'pan-y' }}>
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className={${home && 'h-32'} ...} will stringify to include the literal class "false" when home is not passed (e.g., in Testimonials.jsx). This produces an unintended class name in the DOM; switch to a conditional join/utility (e.g., only include 'h-32' when home is truthy) so no boolean gets coerced into the class string.

Suggested change
<blockquote className={`${home && 'h-32'} max-h-32 px-6 overflow-y-auto`} style={{ touchAction: 'pan-y' }}>
<blockquote className={`${home ? 'h-32 ' : ''}max-h-32 px-6 overflow-y-auto`} style={{ touchAction: 'pan-y' }}>

Copilot uses AI. Check for mistakes.
### Formulas Used

**Mifflin-St Jeor Equation:**
- Male: BMR = 10 × weight(kg) + 6.25 × height(cm) − 5 × age − 5
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README’s Mifflin–St Jeor equation for males is incorrect: the constant should be "+ 5" (not "− 5"). This currently conflicts with the implementation in BmrTdeeCalculator.jsx and could mislead users; please correct the formula text.

Suggested change
- Male: BMR = 10 × weight(kg) + 6.25 × height(cm) − 5 × age 5
- Male: BMR = 10 × weight(kg) + 6.25 × height(cm) − 5 × age + 5

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
// Do not modify the content of this file
export { default as BmrTdeeCalculator } from 'plays/bmr-tdee-calculator/BmrTdeeCalculator';
export { default as CodeEditor } from 'plays/code-editor/CodeEditor';
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as a fix for the Testimonials carousel swipe issue, but it also adds a new play (BMR/TDEE calculator) and updates the plays export index. Please either update the PR title/description to reflect the additional scope, or (preferably) split the new play into a separate PR so the bug fix can be reviewed and released independently.

Copilot uses AI. Check for mistakes.
@aniketmishra-0
Copy link
Contributor Author

Scroll.Manually.webm

✅ Auto-play carousel
✅ Manual swipe (mobile touch)
✅ Navigation arrows (desktop)
✅ Keyboard navigation
✅ Vertical scroll inside testimonial card

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.

🐛 [Bug report]: Testimonials Carousel Not Working - Swipe Navigation Stuck on Mobile

1 participant