From e1d68e2a8da4b9ec2994fd0cb7e6c14d1bb8c4ce Mon Sep 17 00:00:00 2001 From: Iliyas M Date: Thu, 27 Feb 2025 22:59:36 +0530 Subject: [PATCH] Use `replaceState` instead of `pushState` for `forms` and `infolists` tab updates. This change updates tab behavior to replace the current URL instead of adding a new entry to the browser history. It prevents creating unnecessary history entries, resulting in a smoother user experience when switching tabs. --- packages/forms/resources/views/components/tabs.blade.php | 2 +- packages/infolists/resources/views/components/tabs.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/forms/resources/views/components/tabs.blade.php b/packages/forms/resources/views/components/tabs.blade.php index eadfc5c179..2eea531ea3 100644 --- a/packages/forms/resources/views/components/tabs.blade.php +++ b/packages/forms/resources/views/components/tabs.blade.php @@ -26,7 +26,7 @@ const url = new URL(window.location.href) url.searchParams.set(@js($getTabQueryStringKey()), this.tab) - history.pushState(null, document.title, url.toString()) + history.replaceState(null, document.title, url.toString()) }, }" x-init=" diff --git a/packages/infolists/resources/views/components/tabs.blade.php b/packages/infolists/resources/views/components/tabs.blade.php index eefb9ee44b..3753be6a71 100644 --- a/packages/infolists/resources/views/components/tabs.blade.php +++ b/packages/infolists/resources/views/components/tabs.blade.php @@ -25,7 +25,7 @@ const url = new URL(window.location.href) url.searchParams.set(@js($getTabQueryStringKey()), this.tab) - history.pushState(null, document.title, url.toString()) + history.replaceState(null, document.title, url.toString()) }, }" x-init="