Skip to content

fix: resolve iOS voting popup comment input focus issue#307

Open
cmateos91 wants to merge 1 commit into
QuoteVote:mainfrom
cmateos91:fix/114-ios-voting-popup-focus
Open

fix: resolve iOS voting popup comment input focus issue#307
cmateos91 wants to merge 1 commit into
QuoteVote:mainfrom
cmateos91:fix/114-ios-voting-popup-focus

Conversation

@cmateos91
Copy link
Copy Markdown

Summary

Fixes #114 — On iOS mobile, the comment input inside the voting popup did not reliably accept focus when tapped.

  • Root cause: The mousedown event handler on #popButtons called e.preventDefault() unconditionally, which blocks iOS Safari's focus chain (iOS synthesizes mousedown from touch events)
  • Fix: Skip preventDefault when the target is an input or textarea element, so native focus behavior works correctly on iOS
  • Auto-focus: Added useRef + useEffect to programmatically focus the input when the comment panel opens (after the Zoom animation completes)
  • Larger tap target: Increased input minHeight to 50px and set fontSize: 1rem (~25% larger) for better mobile accessibility

Acceptance Criteria

  • Input field accepts focus on the first tap in iOS Safari
  • On-screen keyboard appears consistently when tapped
  • Input field height increased by 25% for better tap-target accessibility
  • Tested on iOS Safari

Test plan

  • Open the app on an iOS device (Safari and Chrome)
  • Select text in a post to trigger the voting popup
  • Tap the comment icon (3rd icon)
  • Tap the "Type comment here" input — keyboard should appear on first tap
  • Verify the input field is visibly larger than before
  • Verify voting buttons (like/dislike) still work correctly
  • Verify desktop behavior is unchanged

🤖 Generated with Claude Code

The mousedown preventDefault on the #popButtons container was blocking
iOS Safari from focusing the comment input field. Now excludes input/textarea
elements from preventDefault, adds programmatic focus via useRef when the
comment panel opens, and increases input height by 25% for better mobile
tap-target accessibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 1, 2026

Deploy Preview for quotevote ready!

Name Link
🔨 Latest commit 99819ad
🔍 Latest deploy log https://app.netlify.com/projects/quotevote/deploys/69cd95425bcf33000859a3c3
😎 Deploy Preview https://deploy-preview-307--quotevote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@flyblackbox
Copy link
Copy Markdown
Contributor

Thank you @cmateos91 for your great work! @Om7035 will review and provide feedback or merge

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: Voting Popup Comment Input Hard to Focus on Mobile iOS

3 participants