From 70e0a684ae7f818f78bb2129a399ae591718bf37 Mon Sep 17 00:00:00 2001 From: velzie Date: Sat, 31 Aug 2024 14:57:40 -0400 Subject: [PATCH] fix location.href --- src/client/location.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/location.ts b/src/client/location.ts index c8dd31d..c13a73e 100644 --- a/src/client/location.ts +++ b/src/client/location.ts @@ -43,6 +43,12 @@ export function createLocationProxy( if (native.set) { desc.set = new Proxy(native.set, { apply(target, thisArg, args) { + if (prop === "href") { + // special case + client.url = args[0]; + return; + } + let url = new URL(client.url.href); url[prop] = args[0]; client.url = url;