Skip to content

Commit

Permalink
Revert behavior of hotwired#1079
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Feb 26, 2024
1 parent 4b1f3f8 commit cda7f16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/drive/page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/fixtures/page_refresh.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h3>Element with Stimulus controller</h3>
</label>
<button>Form with params to refresh the page</button>
</form>
<p><a id="replace-link" data-turbo-action="replace" href="/src/tests/fixtures/page_refresh.html?param=something">Link with params to refresh the page</a></p>
<p><a id="replace-link" data-turbo-action="replace" href="/src/tests/fixtures/page_refresh.html?tab=something">Link with params should not refresh the page</a></p>
<p><a id="refresh-link" data-turbo-action="replace" href="/src/tests/fixtures/page_refresh.html">Link to the same page</a></p>
<p><a id="link" href="/src/tests/fixtures/one.html">Link to another page</a></p>

Expand Down
2 changes: 1 addition & 1 deletion src/tests/functional/page_refresh_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit cda7f16

Please sign in to comment.