Skip to content

fix: touch to interact work on mobile#255

Merged
imrishabh18 merged 4 commits intotscircuit:mainfrom
krushnarout:fix/mobile-interact
May 5, 2025
Merged

fix: touch to interact work on mobile#255
imrishabh18 merged 4 commits intotscircuit:mainfrom
krushnarout:fix/mobile-interact

Conversation

@krushnarout
Copy link
Copy Markdown
Contributor

fixes #251
closes #253
/claim #251

Screen.Recording.2025-05-02.at.8.26.51.PM.mov

@vercel
Copy link
Copy Markdown

vercel bot commented May 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pcb-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2025 2:05pm

e.currentTarget.setAttribute(
"data-touch-start-x",
touch.clientX.toString(),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you should store this using a useRef

}}
>
Click to Interact
{typeof window !== "undefined" && window.innerWidth < 768
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure i like this approach using window size, it's ok but is there not a better way to detect touch devices? Ipads would fail this test for example

@imrishabh18 imrishabh18 merged commit 0914288 into tscircuit:main May 5, 2025
4 checks passed
@krushnarout krushnarout deleted the fix/mobile-interact branch May 5, 2025 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On mobile display “Touch to Interact” instead of Click to Interact Click to interact doesnt work on mobile

3 participants