diff --git a/src/core/drive/page_view.js b/src/core/drive/page_view.js index e787e87aa..db583f226 100644 --- a/src/core/drive/page_view.js +++ b/src/core/drive/page_view.js @@ -61,7 +61,7 @@ export class PageView extends View { } isPageRefresh(visit) { - return !visit || (this.lastRenderedLocation.pathname === visit.location.pathname && visit.action === "replace") + return !visit || (this.lastRenderedLocation.href === visit.location.href && visit.action === "replace") } isReplaceMethodMorph(visit) { diff --git a/src/tests/fixtures/page_refresh.html b/src/tests/fixtures/page_refresh.html index 35cb44354..bc67d4ec2 100644 --- a/src/tests/fixtures/page_refresh.html +++ b/src/tests/fixtures/page_refresh.html @@ -112,7 +112,7 @@
Link with params to refresh the page
+ diff --git a/src/tests/functional/page_refresh_tests.js b/src/tests/functional/page_refresh_tests.js index 6619ae58e..90d49a29b 100644 --- a/src/tests/functional/page_refresh_tests.js +++ b/src/tests/functional/page_refresh_tests.js @@ -106,7 +106,7 @@ test("renders a page refresh with morphing when the paths are the same but searc await page.goto("/src/tests/fixtures/page_refresh.html") await page.click("#replace-link") - await nextEventNamed(page, "turbo:render", { renderMethod: "morph" }) + await nextEventNamed(page, "turbo:render", { renderMethod: "replace" }) }) test("renders a page refresh with morphing when the GET form paths are the same but search params are diferent", async ({ page }) => {