Skip to content

Add unsaved changes warning when navigating away from New Rounds page#403

Open
Sanika123-art wants to merge 2 commits intohatnote:masterfrom
Sanika123-art:fix/add-round-button-issue
Open

Add unsaved changes warning when navigating away from New Rounds page#403
Sanika123-art wants to merge 2 commits intohatnote:masterfrom
Sanika123-art:fix/add-round-button-issue

Conversation

@Sanika123-art
Copy link

This PR addresses Issue #64: “Need warning when navigating away from New Rounds page”.

Changes included:

Added a confirmation prompt when the user tries to leave the New Rounds page with unsaved changes.

Works for both browser refresh/close (beforeunload) and internal route navigation (onBeforeRouteLeave).

Tracks changes in the round form using a isDirty reactive variable.

Ensures the warning is removed when the user cancels the form or successfully submits a new round.

Removed duplicate submitRound declaration to fix the Vite compilation error.

Behavior:

If the user edits the form and attempts to navigate away or refresh the page, a confirmation dialog appears.

After successfully submitting a round, the warning no longer appears.

Impact:

Prevents loss of unsaved round data and improves user experience when creating new rounds.

sanika palav and others added 2 commits March 7, 2026 22:06
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.

2 participants