From 64c5a51ffa06bb3ee05aa652b13e246ce21327f6 Mon Sep 17 00:00:00 2001 From: Jude Gao Date: Fri, 4 Apr 2025 06:33:35 +0800 Subject: [PATCH] doc: onNavigate follow-up --- .../04-api-reference/02-components/link.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/01-app/04-api-reference/02-components/link.mdx b/docs/01-app/04-api-reference/02-components/link.mdx index af0bb06ac2a67..e975fa0819a60 100644 --- a/docs/01-app/04-api-reference/02-components/link.mdx +++ b/docs/01-app/04-api-reference/02-components/link.mdx @@ -1362,11 +1362,11 @@ export function CustomLink({ children, ...props }: CustomLinkProps) { return ( { - if (isBlocked) { + if ( + isBlocked && + !window.confirm('You have unsaved changes. Leave anyway?') + ) { e.preventDefault() - if (!window.confirm('You have unsaved changes. Leave anyway?')) { - e.preventDefault() - } } }} {...props} @@ -1389,11 +1389,11 @@ export function CustomLink({ children, ...props }) { return ( { - if (isBlocked) { + if ( + isBlocked && + !window.confirm('You have unsaved changes. Leave anyway?') + ) { e.preventDefault() - if (!window.confirm('You have unsaved changes. Leave anyway?')) { - e.preventDefault() - } } }} {...props}