Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

  • Adds beforeunload event handler to show browser confirmation dialog when navigating away
  • Prevents accidental page exits from browser back gestures (right-click + drag left)
  • Also helps prevent losing unsaved diagram work on page refresh/close

Closes #80

Test plan

  • Test right-click drag in draw.io canvas triggers confirmation dialog instead of navigating
  • Test closing tab shows confirmation dialog
  • Test page refresh shows confirmation dialog

Addresses conflict between right-click drag and browser back gesture in
Chromium-based browsers. Shows browser confirmation dialog when user
tries to navigate away, preventing accidental page exits.

Closes #80
@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Building Building Preview Comment Dec 5, 2025 9:42am

@DayuanJiang DayuanJiang merged commit 3ef9908 into main Dec 5, 2025
3 of 4 checks passed
@DayuanJiang DayuanJiang deleted the feat/prevent-back-gesture-navigation branch December 5, 2025 09:42
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.

Conflict Between Right-Click Drag and Browser Back Gesture Causes Unintentional Page Navigation

2 participants