Update PreventNavigation.tsx

This commit is contained in:
Nate Kelley 2025-04-03 11:05:09 -06:00
parent c350cbae47
commit 2304ed59bc
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,11 @@ export const PreventNavigation: React.FC<PreventNavigationProps> = React.memo(
target = target.parentElement as HTMLElement;
}
// Check if we're navigating to the same URL - if so, allow the navigation
if (href && new URL(href).pathname === window.location.pathname) {
return; // Allow navigation to the same URL
}
if (isDirty) {
event.preventDefault();
event.stopPropagation();