fix : showing progress for true nav
This commit is contained in:
@@ -31,6 +31,7 @@ export function GuideSectionNav({
|
||||
const browserWindow = window as Window & { __guideHasUnsavedChanges?: boolean };
|
||||
if (typeof window !== "undefined" && browserWindow.__guideHasUnsavedChanges && !window.confirm("ข้อมูลยังบันทึกไม่เสร็จหรือไม่ถูกต้อง ต้องการออกจากหน้านี้หรือไม่?")) {
|
||||
event.preventDefault();
|
||||
Object.assign(event.nativeEvent, { pageProgressCancelled: true });
|
||||
}
|
||||
};
|
||||
return (
|
||||
|
||||
@@ -13,7 +13,7 @@ function PageProgressContent() {
|
||||
// Start progress on click
|
||||
useEffect(() => {
|
||||
const handleClick = (e: MouseEvent) => {
|
||||
if (e.defaultPrevented) return
|
||||
if ("pageProgressCancelled" in e) return
|
||||
|
||||
const target = (e.target as HTMLElement).closest("a")
|
||||
if (!target) return
|
||||
|
||||
Reference in New Issue
Block a user