901 B
901 B
Mobile Long Press Card Preview
Status
- Research current implementation of
PackCardandCardPreview - Implement long-press detection in
PackCard(Found existing implementation inCardPreview) - Prevent default browser context menu on card images
- Trigger preview on long-press only for small screens (or generally if touch)
- Verify implementation
Context
User reported that long-pressing a card on mobile opens the browser menu (download image context menu). Goal: Long press should show the card preview instead.
Implementation Details
- Modified
CardHoverWrapperinCardPreview.tsxto preventcontextmenuevent default behavior on mobile devices when an image is present. - This ensures the custom long-press timer has time to trigger the preview without the system menu interfering.
- Logic uses
isMobile && hasImageto target specific scenario.